From 967ae6278f8429dc268f8d3252de048eba86fe29 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Sun, 10 May 2020 00:52:54 -0700 Subject: Run rb_syswait on exec failure not only when !w but also when w == WAITPID_LOCK_ONLY. See also: f7c0cc36920a4ed14a3ab1ca6cfdf18ceff1e5d5 and a2264342063260d660b99872eaf5080f6ab08e81. We thought this change was an oversight in the latter commit. Without this change, the test fails like: $ make test-all TESTS="../test/ruby/test_process.rb -n test_exec_failure_leaves_no_child" RUN_OPTS="--jit" ... 1) Failure: TestProcess#test_exec_failure_leaves_no_child [/home/k0kubun/src/github.com/ruby/ruby/test/ruby/test_process.rb:2493]: Expected [[26799, #]] to be empty. Co-Authored-By: Yusuke Endoh --- process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'process.c') diff --git a/process.c b/process.c index e5cfed8cf2..7ec3b54336 100644 --- a/process.c +++ b/process.c @@ -4046,7 +4046,7 @@ fork_check_err(int *status, int (*chfunc)(void*, char *, size_t), void *charg, "only used by extensions"); rb_protect(proc_syswait, (VALUE)pid, status); } - else if (!w) { + else if (!w || w == WAITPID_LOCK_ONLY) { rb_syswait(pid); } errno = err; -- cgit v1.2.3