Commit Graph

27 Commits

Author SHA1 Message Date
Tom Hacohen c662934be8 Change the EFL to follow the new Eo rename. 2016-08-11 17:04:43 +01:00
Tom Hacohen f21ade6123 Automatic migration to Eo4.
I just ran my script (email to follow) to migrate all of the EFL
automatically. This commit is *only* the automatic conversion, so it can
be easily reverted and re-run.
2016-03-03 09:58:08 +00:00
Vincent Torri 5a3fb40b4c ecore_exe: terminate threads also in destructor
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-10-19 14:48:49 -07:00
Tom Hacohen d8eae4d4e5 Ecore exe win32: Fix double-free errors.
As reported by vtorri, sometimes ecore_exe on win32 will encounter double
free issues. This was because the variable was freed, but not set to NULL
as expected by the cleanup function.

Fixes T2675

@fix
2015-10-13 14:41:57 +01:00
Vincent Torri 18cbdad446 ecore_exe: avoid thread doing nothing by adding a small sleep
This fixes the CPU to be usedat 100% for each thread in ecore_exe. This
is obviously not an ideal fix and will be improved in the future.

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-10-12 17:21:59 -07:00
Vincent Torri ce4ef2cf91 ecore_exe: close handles only if they are valid
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-10-12 17:21:59 -07:00
Vincent Torri 1885086413 ecore_exe: fix command line when a shell is used, and increase buffer to 32768 bytes
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-10-12 17:21:59 -07:00
Vincent Torri b8a9684755 ecore_exe: remove infinite loop when killin process
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-10-12 17:21:59 -07:00
Vincent Torri ee8df155d9 ecore_exe: use macro to free resources
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-10-12 17:21:59 -07:00
Vincent Torri 8c8bfda978 ecore_exe: better error message when child process can not be run
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-10-12 17:21:59 -07:00
Vincent Torri dd45d7f744 ecore_exe: make sure that ReadFile() will not hang
When child process exits, ReadFile() will hang if those pipes are maintained

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-10-12 17:21:59 -07:00
Vincent Torri f1a2c22dc3 ecore_exe: read remaining data when the child application has closed
Output and error threads could not read all the data sent by the child.

Based on a patch by Guillaume Friloux

@fix

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-10-12 17:21:59 -07:00
ChunEon Park d71182af7a ecore win32: increase command buffer size.
PATH_MAX is not enough for command.
Even in this case, the buffer is not being used only for path.
2015-08-29 16:59:19 +09:00
ChunEon Park 0647f68770 ecore win32: modifiy to better meaningful exception. 2015-08-29 16:46:22 +09:00
Vincent Torri f965fbe623 Ecore Exe: decrease log level on Windows 2015-07-07 13:22:16 +01:00
Tom Hacohen a3e3afeb01 Ecore exe (windows): Fix object destruction/failed creation.
The correct way of disposing of an object in a failed finalisation is to
return NULL, not to delete it.

Also, since the destructor is already called when the object is deleted
anyway, there's no point in having cleanup code in the finalizer too.

@fix
2015-07-07 12:05:34 +01:00
Vincent Torri a53c52dee0 Ecore_Exe: remove process_id field as it is a duplicate of the pid one
It breaks ABI on Windows (not a big deal at this stage).

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-05-07 09:53:07 +02:00
Andrii Kroitor 1c3dbc3267 ecore_exe: fix ecore_exe_pid_get on windows
Summary:
ecore_exe_pid_get returns exe->pid value so it should be filled

@fix

Reviewers: raster, seoz, cedric, Hermet

Subscribers: NikaWhite, cedric, reutskiy.v.v

Differential Revision: https://phab.enlightenment.org/D2195

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-03-23 19:37:24 +01:00
Andrii Kroitor 9f96d4996c ecore_win32: fix segfault
Summary:
_ecore_exe_pipe_read_thread_cb and _ecore_exe_pipe_error_thread_cb expecting
object as argument.

Reviewers: cedric, seoz, Hermet

Subscribers: cedric, reutskiy.v.v

Differential Revision: https://phab.enlightenment.org/D2185

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-03-18 11:05:24 +01:00
Adrien Nader e9e61718d1 ecore_exe_win32: CreateProcess was called with random flags.
CreateProcess() has a flags parameter which is being passed
"run_pri | CREATE_SUSPENDED".

The issue lies in the value of run_pri. It is best explained by the
following code somewhere else in the file:

   switch (run_pri)
     {
      case IDLE_PRIORITY_CLASS:
        return ECORE_EXE_WIN32_PRIORITY_IDLE;

The run_pri variable is supposed to store a value from the win32 API while
it was used to store one from the ecore API.

If I recall correctly, the windows one is equal to 32 and the ecore one to
9999. Meaning 9999 ended up used as flags so let's have a look at what that
actually enabled; the reference is "Process Creation Flags" from MSDN
http://msdn.microsoft.com/en-us/library/ms684863%28v=vs.85%29.aspx .

9999 gives 0x0000270F and this matches
  DEBUG_PROCESS | DETACHED_PROCESS | DEBUG_ONLY_THIS_PROCESS
  | CREATE_SUSPENDED | CREATE_NEW_PROCESS_GROUP | CREATE_SEPARATE_WOW_VDM
  | CREATE_UNICODE_ENVIRONMENT | <0x00002000 matches nothing>

Matches nothing? Weird. Well, maybe. Except that I stumbled upon this define
in the mingw-w64 headers:
  #define CREATE_FORCEDOS 0x2000

Mingw-w64 only has a #define, Wine has nothing (they don't do DOS anyway),
but ReactOS has some code about it:
  https://git.reactos.org/?p=reactos.git;a=blob;f=reactos/dll/win32/kernel32/client/proc.c;hb=f60941f8dc775427af04eb0a3c3e4d38160c7641#l3007

Overall the actual set of flags probably made very little sense and wasn't
working very well. :)

I also noticed the following in the mingw-w64 headers:
  #define INHERIT_CALLER_PRIORITY 0x20000

This should be a better match for what seemed to be the original intent of
inheriting the priority. I haven't tested it and it's only documented on
MSDN for Windows CE and similar so I'm really not sure about what it does.

MSDN however mentions that the child processes will have at most the
"normal" priority by default (same as its parent if the parent has less
than the default one) but I'm under the impression a process can raise its
own priority level... Anyway, "NORMAL_PRIORITY_CLASS" will do for now.

With this change and a couple others, elementary's theme builds properly
on Windows (_on_ Windows). I'll assess the usefulness of the other changes
in my tree over the next few days.

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2014-10-25 16:42:00 +02:00
Tom Hacohen 686acd88f7 Ecore exe: refactor and fix compilation on windows.
This is the first step towards splitting it nicely. This fixes
compilation on windows (or so it seems from my testing) and takes out
all the platform specific code (posix included) out of the main source
file.
2014-08-27 15:14:17 +01:00
Tom Hacohen d4f6870bb5 Ecore exe: Fix windows build by making the windows stuff less redundant.
This should fix the dumb way it was split until now (everything was redundant).
Now we just reimplement the parts we need to reimplement and the rest is shared.
The win32 code is called from within the normal code.
2014-08-26 16:48:07 +01:00
Tom Hacohen 7cbfa52dd5 Ecore exe: Fix compilation on windows (fix inlist usage).
Hopefully. I don't have a winodws box to test it on. Go Jenkins go.
2014-08-26 15:21:05 +01:00
Tom Hacohen 40aa38c164 Ecore exe: Fix compilation on windows.
Hopefully. I don't have a winodws box to test it on. Go Jenkins go.
2014-08-26 15:16:00 +01:00
Vincent Torri b9d2972739 ecore: improve and fix various issue in Ecore_Exe windows implementation.
Signed-off-by: Cedric Bail <cedric.bail@free.fr>
2014-04-25 14:35:38 +02:00
Carsten Haitzler c3d6a1478f windows build - comment out unused function in ecore_pipe 2014-01-08 22:46:51 +09:00
Vincent Torri 7d6010b12c merge: add escape ecore, fix several bugs
SVN revision: 79995
2012-12-02 22:35:45 +00:00