зеркало из https://github.com/github/ruby.git
* 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:
Родитель
6b87ac68db
Коммит
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>
|
||||
|
||||
* process.c (rb_f_system): block SIGCHLD during the process
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче