From 40937ec3218388321d897af0110884a0a1cce5c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Sat, 29 Nov 2014 14:45:33 +0000 Subject: [PATCH] [INTERPRETER] * BUG: Process: Don't call the Read event if there is nothing to read. git-svn-id: svn://localhost/gambas/trunk@6686 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- main/gbx/gbx_c_process.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main/gbx/gbx_c_process.c b/main/gbx/gbx_c_process.c index 08f403b37..ee363e75e 100644 --- a/main/gbx/gbx_c_process.c +++ b/main/gbx/gbx_c_process.c @@ -165,8 +165,11 @@ static void callback_write(int fd, int type, CPROCESS *process) if (n > 0) process->result = STRING_add(process->result, COMMON_buffer, n); } - else if (GB_CanRaise(process, EVENT_Read) && !STREAM_is_closed(CSTREAM_stream(process))) // && !STREAM_eof(CSTREAM_stream(process))) //process->running && - GB_Raise(process, EVENT_Read, 0); + else if (GB_CanRaise(process, EVENT_Read) && !STREAM_is_closed(CSTREAM_stream(process))) + { + if (!STREAM_eof(CSTREAM_stream(process))) + GB_Raise(process, EVENT_Read, 0); + } else close_fd(&process->out); }