Commit Graph

41 Commits

Author SHA1 Message Date
Carsten Haitzler dc137aba43 ecore exe - fix fix malloc fail handling
for both ecore_exe_win32.c and ecore_exe_posix.c when the rare case
(basically almost never) that malloc fails for the exe read/err
buffers also set the data size to 0 so it doesn't lie with a NULL ptr
for data.

@fix
2017-09-15 07:44:58 +09:00
Carsten Haitzler 829d0bc3f9 ecore win32 exe handling - check realloc and malloc returns
handle out of memory errors better
@fix
2017-07-24 16:57:22 +09:00
Andrii Kroitor 792acc9f9e ecore_exe: do not try to send 0 bytes
Summary: This action is meaningless when communicating with child process.

Reviewers: barbieri

Reviewed By: barbieri

Subscribers: jpeg, vtorri, cedric, raster

Differential Revision: https://phab.enlightenment.org/D4510
2016-12-22 19:28:44 +02:00
Andrii Kroitor 7e156742b3 ecore_exe_win32: fix typo in input poll thread 2016-12-22 14:39:33 +02:00
Andrii Kroitor 11e687578d ecore_exe: fix send on Windows
Check for bytes written only if more than 0 bytes were sent.
I don't know why some efl code is trying to send 0 bytes, but that works on
Linux and therefore should be fixed on Windows.
2016-12-22 14:13:40 +02:00
Andrii Kroitor bceb263910 ecore_exe is broken on Windows
Summary:
T4938

diff from @raster
Aaaargh! There is no other way to get code from diff on phab..

Reviewers: vtorri

Subscribers: vtorri, i.furs, cedric, jpeg, raster

Differential Revision: https://phab.enlightenment.org/D4448
2016-12-22 11:11:02 +09:00
Andrii Kroitor 52d4313bb6 ecore_exe: fix ecore_exe_send on Windows
Do not repeat already sent data.
Remove pipe_write.data_buf because data was sent directly anyway and it was
used only in this method.
2016-12-08 15:18:46 +02:00
Andrii Kroitor 6f6323d12e Revert "exore_exe: fix from @raster"
This reverts commit c505b754ce.

Accidentally pushed this with build fix. Sorry :(
This commit is related to T4938 and it's goint to be updated, checked and pushed later.
2016-12-08 14:16:38 +02:00
Andrii Kroitor c505b754ce exore_exe: fix from @raster 2016-12-08 14:07:02 +02:00
Vyacheslav Reutskiy 299471991c ecore_exe_win32: fix ecore_exe_send
Write to the child pipe corect data size.
@fix
2016-12-02 11:50:39 +02:00
Carsten Haitzler b3361f1aad ecore exe - handle scope data get null returns when ppl do bad things
peolpe using ecore_exe in threads... for example.
2016-12-01 08:49:25 +09:00
Vitor Sousa f02ff462e7 efl callbacks: update some events calls to no longer trigger legacy callbacks 2016-08-30 13:59:59 -03:00
Vitor Sousa 8356b16a49 Efl Object: remove legacy callback calls from event_callback_call
Efl.Object.event_callback_call no longer calls legacy smart callbacks;
calling only event callbacks registered with the given event description
pointer.

Create the method Efl.Object.event_callback_legacy_call to inherit the old
behavior from Efl.Object.event_callback_call, calling both Efl.Object events
and legacy smart callbacks.

Update all other files accordingly in order to still supply legacy
callbacks while they are necessary.
2016-08-26 15:45:07 -03:00
Tom Hacohen e65aae994e Eo: Finish the renaming of Eo to the EFL.
This renames all the rest of the API to the EFL namespace except for
Eo_Event that will follow soon.

Obviously breaks both API and ABI.
2016-08-15 15:07:42 +01:00
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