* 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
This commit is contained in:
parent
6b87ac68db
commit
553bba0b47
@ -1,3 +1,8 @@
|
|||||||
|
Tue Jul 18 23:53:59 2006 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
|
* process.c (rb_f_system): shouldn't block SIGCHLD if it's not
|
||||||
|
exist.
|
||||||
|
|
||||||
Tue Jul 18 22:10:13 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Tue Jul 18 22:10:13 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* process.c (rb_f_system): block SIGCHLD during the process
|
* process.c (rb_f_system): block SIGCHLD during the process
|
||||||
|
@ -1591,16 +1591,20 @@ static VALUE
|
|||||||
rb_f_system(int argc, VALUE *argv)
|
rb_f_system(int argc, VALUE *argv)
|
||||||
{
|
{
|
||||||
int status;
|
int status;
|
||||||
|
#ifdef SIGCHLD
|
||||||
RETSIGTYPE (*chfunc)(int);
|
RETSIGTYPE (*chfunc)(int);
|
||||||
|
|
||||||
chfunc = signal(SIGCHLD, SIG_DFL);
|
chfunc = signal(SIGCHLD, SIG_DFL);
|
||||||
|
#endif
|
||||||
status = rb_spawn(argc, argv);
|
status = rb_spawn(argc, argv);
|
||||||
if (status > 0) {
|
if (status > 0) {
|
||||||
#if defined(HAVE_FORK) || defined(HAVE_SPAWNV)
|
#if defined(HAVE_FORK) || defined(HAVE_SPAWNV)
|
||||||
rb_syswait(status);
|
rb_syswait(status);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
#ifdef SIGCHLD
|
||||||
signal(SIGCHLD, chfunc);
|
signal(SIGCHLD, chfunc);
|
||||||
|
#endif
|
||||||
if (status < 0) {
|
if (status < 0) {
|
||||||
rb_sys_fail(RSTRING(argv[0])->ptr);
|
rb_sys_fail(RSTRING(argv[0])->ptr);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user