From 792acc9f9eaf8587490ea7cc5a984689f7283502 Mon Sep 17 00:00:00 2001 From: Andrii Kroitor Date: Thu, 22 Dec 2016 18:49:27 +0200 Subject: [PATCH] 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 --- src/lib/ecore/ecore_exe.c | 2 ++ src/lib/ecore/ecore_exe_win32.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/ecore/ecore_exe.c b/src/lib/ecore/ecore_exe.c index 6cf7e59718..dcf9ceaa86 100644 --- a/src/lib/ecore/ecore_exe.c +++ b/src/lib/ecore/ecore_exe.c @@ -126,6 +126,8 @@ ecore_exe_send(Ecore_Exe *obj, if (!efl_isa(obj, MY_CLASS)) return EINA_FALSE; + EINA_SAFETY_ON_TRUE_RETURN_VAL(size == 0, EINA_TRUE); + if (exe->close_stdin) { ERR("Ecore_Exe %p stdin is closed! Cannot send %d bytes from %p", diff --git a/src/lib/ecore/ecore_exe_win32.c b/src/lib/ecore/ecore_exe_win32.c index 6479985622..33854f89be 100644 --- a/src/lib/ecore/ecore_exe_win32.c +++ b/src/lib/ecore/ecore_exe_win32.c @@ -560,7 +560,7 @@ _impl_ecore_exe_send(Ecore_Exe *obj, BOOL res; res = WriteFile(exe->pipe_write.child_pipe_x, data, size, &num_exe, NULL); - if (size && !res || num_exe == 0) + if (!res || num_exe == 0) { ERR("Ecore_Exe %p stdin is closed! Cannot send %d bytes from %p", obj, size, data);