diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-08-29 13:02:45 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-08-29 13:02:45 +0000 |
commit | 7c854d6d5e1611f0d4625637661dc03f49cbc942 (patch) | |
tree | 0131be168ea438552cd88c7e8f51e82b7076f634 /process.c | |
parent | 22c81db9d8bd5087e4c1a0d4771873ad7d58ad88 (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.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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 |