summaryrefslogtreecommitdiff
path: root/process.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-08-29 13:02:45 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-08-29 13:02:45 +0000
commit7c854d6d5e1611f0d4625637661dc03f49cbc942 (patch)
tree0131be168ea438552cd88c7e8f51e82b7076f634 /process.c
parent22c81db9d8bd5087e4c1a0d4771873ad7d58ad88 (diff)
* process.c (rb_f_system): check failures of waitpid.
[ruby-talk:398687] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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