From 10e11205352966a26d1731ad1807470c5e3fb16e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Kochma=C5=84ski?= Date: Fri, 11 Sep 2015 11:49:02 +0200 Subject: [PATCH] external-process-wait: check code after status change MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Related to #149 Signed-off-by: Daniel Kochmański --- src/c/unixsys.d | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/c/unixsys.d b/src/c/unixsys.d index 981a25b..f5c1ee2 100644 --- a/src/c/unixsys.d +++ b/src/c/unixsys.d @@ -356,10 +356,10 @@ make_windows_handle(HANDLE h) * here: status is updated _after_ code, and hence we * check it _before_ code. */ do { - status = external_process_status(process); - code = external_process_code(process); ecl_musleep(0.0, 1); + status = external_process_status(process); } while (status == @':running'); + code = external_process_code(process); } else { status = ecl_waitpid(pid, wait); code = ecl_nth_value(the_env, 1); -- 2.9.0