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:
Andrii Kroitor 2016-12-08 15:15:38 +02:00
parent 698631578f
commit 52d4313bb6
2 changed files with 1 additions and 12 deletions

View File

@ -92,8 +92,6 @@ struct _Ecore_Exe_Data
{
HANDLE child_pipe;
HANDLE child_pipe_x;
void *data_buf;
int data_size;
} pipe_write;
struct

View File

@ -558,19 +558,10 @@ _impl_ecore_exe_send(Ecore_Exe *obj,
const void *data,
int size)
{
void *buf = NULL;
DWORD num_exe;
BOOL res;
buf = realloc(exe->pipe_write.data_buf, exe->pipe_write.data_size + size);
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);
res = WriteFile(exe->pipe_write.child_pipe_x, data, size, &num_exe, NULL);
if (!res || num_exe == 0)
{
ERR("Ecore_Exe %p stdin is closed! Cannot send %d bytes from %p",