diff options
Diffstat (limited to 'src/os_unix.c')
-rw-r--r-- | src/os_unix.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/os_unix.c b/src/os_unix.c index 043d0a800..860fbcc40 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -3734,24 +3734,21 @@ wait4pid(child, status) while (wait_pid != child) { -# ifdef _THREAD_SAFE - /* Ugly hack: when compiled with Python threads are probably - * used, in which case wait() sometimes hangs for no obvious - * reason. Use waitpid() instead and loop (like the GUI). */ -# ifdef __NeXT__ + /* When compiled with Python threads are probably used, in which case + * wait() sometimes hangs for no obvious reason. Use waitpid() + * instead and loop (like the GUI). Also needed for other interfaces, + * they might call system(). */ +# ifdef __NeXT__ wait_pid = wait4(child, status, WNOHANG, (struct rusage *)0); -# else +# else wait_pid = waitpid(child, status, WNOHANG); -# endif +# endif if (wait_pid == 0) { /* Wait for 1/100 sec before trying again. */ mch_delay(10L, TRUE); continue; } -# else - wait_pid = wait(status); -# endif if (wait_pid <= 0 # ifdef ECHILD && errno == ECHILD |