summaryrefslogtreecommitdiff
path: root/process.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-07-18 14:55:28 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-07-18 14:55:28 +0000
commit553bba0b4734f2fbf4ccf09523ba1c91d5659ad6 (patch)
tree4eaa67d8b46d80619d06e6ef9e8c91d8d6605b7f /process.c
parent6b87ac68dba3d8967d76233766a174c8a82813e3 (diff)
* process.c (rb_f_system): shouldn't block SIGCHLD if it's not
exist. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'process.c')
-rw-r--r--process.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/process.c b/process.c
index ae9146a928..8d1f07de82 100644
--- a/process.c
+++ b/process.c
@@ -1591,16 +1591,20 @@ static VALUE
rb_f_system(int argc, VALUE *argv)
{
int status;
+#ifdef SIGCHLD
RETSIGTYPE (*chfunc)(int);
chfunc = signal(SIGCHLD, SIG_DFL);
+#endif
status = rb_spawn(argc, argv);
if (status > 0) {
#if defined(HAVE_FORK) || defined(HAVE_SPAWNV)
rb_syswait(status);
#endif
}
+#ifdef SIGCHLD
signal(SIGCHLD, chfunc);
+#endif
if (status < 0) {
rb_sys_fail(RSTRING(argv[0])->ptr);
}