From bf0045d7a4cd4c7d4df3fa34b8a12795e8ee73aa Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 29 Aug 2017 18:13:44 +0300 Subject: [PATCH] Avoid aborting in 'waitpid' on MS-Windows * src/w32proc.c (waitpid): Don't allow quitting if called with WNOHANG in OPTIONS. (Bug#28268) --- src/w32proc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/w32proc.c b/src/w32proc.c index 76af55f9985..ffd5f0d0a1a 100644 --- a/src/w32proc.c +++ b/src/w32proc.c @@ -1449,7 +1449,11 @@ waitpid (pid_t pid, int *status, int options) do { - maybe_quit (); + /* When child_status_changed calls us with WNOHANG in OPTIONS, + we are supposed to be non-interruptible, so don't allow + quitting in that case. */ + if (!dont_wait) + maybe_quit (); active = WaitForMultipleObjects (nh, wait_hnd, FALSE, timeout_ms); } while (active == WAIT_TIMEOUT && !dont_wait); -- 2.39.2