forked from enlightenment/efl
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.
This commit is contained in:
parent
698631578f
commit
52d4313bb6
|
@ -92,8 +92,6 @@ struct _Ecore_Exe_Data
|
||||||
{
|
{
|
||||||
HANDLE child_pipe;
|
HANDLE child_pipe;
|
||||||
HANDLE child_pipe_x;
|
HANDLE child_pipe_x;
|
||||||
void *data_buf;
|
|
||||||
int data_size;
|
|
||||||
} pipe_write;
|
} pipe_write;
|
||||||
|
|
||||||
struct
|
struct
|
||||||
|
|
|
@ -558,19 +558,10 @@ _impl_ecore_exe_send(Ecore_Exe *obj,
|
||||||
const void *data,
|
const void *data,
|
||||||
int size)
|
int size)
|
||||||
{
|
{
|
||||||
void *buf = NULL;
|
|
||||||
DWORD num_exe;
|
DWORD num_exe;
|
||||||
BOOL res;
|
BOOL res;
|
||||||
|
|
||||||
buf = realloc(exe->pipe_write.data_buf, exe->pipe_write.data_size + size);
|
res = WriteFile(exe->pipe_write.child_pipe_x, data, size, &num_exe, NULL);
|
||||||
if (!buf) return EINA_FALSE;
|
|
||||||
|
|
||||||
exe->pipe_write.data_buf = buf;
|
|
||||||
memcpy((char *)exe->pipe_write.data_buf + exe->pipe_write.data_size, data, size);
|
|
||||||
exe->pipe_write.data_size += size;
|
|
||||||
|
|
||||||
res = WriteFile(exe->pipe_write.child_pipe_x, buf, exe->pipe_write.data_size, &num_exe, NULL);
|
|
||||||
printf(" ** res : %d\n", res);
|
|
||||||
if (!res || num_exe == 0)
|
if (!res || num_exe == 0)
|
||||||
{
|
{
|
||||||
ERR("Ecore_Exe %p stdin is closed! Cannot send %d bytes from %p",
|
ERR("Ecore_Exe %p stdin is closed! Cannot send %d bytes from %p",
|
||||||
|
|
Loading…
Reference in New Issue