From 553bba0b4734f2fbf4ccf09523ba1c91d5659ad6 Mon Sep 17 00:00:00 2001 From: usa Date: Tue, 18 Jul 2006 14:55:28 +0000 Subject: [PATCH] * 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 --- ChangeLog | 5 +++++ process.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index 729204ad8e..0479596c53 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Jul 18 23:53:59 2006 NAKAMURA Usaku + + * process.c (rb_f_system): shouldn't block SIGCHLD if it's not + exist. + Tue Jul 18 22:10:13 2006 Yukihiro Matsumoto * process.c (rb_f_system): block SIGCHLD during the process 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); }