aboutsummaryrefslogtreecommitdiffstats
path: root/process.c
diff options
context:
space:
mode:
Diffstat (limited to 'process.c')
-rw-r--r--process.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/process.c b/process.c
index fe0587119e..25eed71a4e 100644
--- a/process.c
+++ b/process.c
@@ -3661,7 +3661,10 @@ rb_f_system(int argc, VALUE *argv)
pid = rb_spawn_internal(argc, argv, NULL, 0);
#if defined(HAVE_FORK) || defined(HAVE_SPAWNV)
if (pid > 0) {
- rb_syswait(pid);
+ int ret, status;
+ ret = rb_waitpid(pid, &status, 0);
+ if (ret == (rb_pid_t)-1)
+ rb_sys_fail("Another thread waited the process started by system().");
}
#endif
#ifdef SIGCHLD