mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
19991012
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
758cb647c7
commit
be1fea072c
19 changed files with 188 additions and 99 deletions
26
signal.c
26
signal.c
|
|
@ -294,6 +294,13 @@ posix_signal(signum, handler)
|
|||
sigact.sa_handler = handler;
|
||||
sigemptyset(&sigact.sa_mask);
|
||||
sigact.sa_flags = 0;
|
||||
#ifdef SA_RESTART
|
||||
sigact.sa_flags |= SA_RESTART; /* SVR4, 4.3+BSD */
|
||||
#endif
|
||||
#ifdef SA_NOCLDWAIT
|
||||
if (signum == SIGCHLD && handler == (RETSIGTYPE)SIG_IGN)
|
||||
sigact.sa_flags |= SA_NOCLDWAIT;
|
||||
#endif
|
||||
sigaction(signum, &sigact, 0);
|
||||
}
|
||||
#define ruby_signal(sig,handle) posix_signal((sig),(handle))
|
||||
|
|
@ -313,9 +320,6 @@ signal_exec(sig)
|
|||
#ifndef NT
|
||||
case SIGHUP:
|
||||
#endif
|
||||
#ifdef SIGPIPE
|
||||
case SIGPIPE:
|
||||
#endif
|
||||
#ifdef SIGQUIT
|
||||
case SIGQUIT:
|
||||
#endif
|
||||
|
|
@ -345,7 +349,7 @@ sighandle(sig)
|
|||
rb_bug("trap_handler: Bad signal %d", sig);
|
||||
}
|
||||
|
||||
#if !defined(POSIX_SIGNAL) && !defined(BSD_SIGNAL)
|
||||
#if !defined(BSD_SIGNAL)
|
||||
ruby_signal(sig, sighandle);
|
||||
#endif
|
||||
|
||||
|
|
@ -508,9 +512,6 @@ trap(arg)
|
|||
#endif
|
||||
#ifdef SIGUSR2
|
||||
case SIGUSR2:
|
||||
#endif
|
||||
#ifdef SIGPIPE
|
||||
case SIGPIPE:
|
||||
#endif
|
||||
func = sighandle;
|
||||
break;
|
||||
|
|
@ -523,6 +524,11 @@ trap(arg)
|
|||
case SIGSEGV:
|
||||
func = sigsegv;
|
||||
break;
|
||||
#endif
|
||||
#ifdef SIGPIPE
|
||||
case SIGPIPE:
|
||||
func = SIG_IGN;
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
@ -614,9 +620,6 @@ Init_signal()
|
|||
#ifndef NT
|
||||
ruby_signal(SIGHUP, sighandle);
|
||||
#endif
|
||||
#ifdef SIGPIPE
|
||||
ruby_signal(SIGPIPE, sighandle);
|
||||
#endif
|
||||
#ifdef SIGQUIT
|
||||
ruby_signal(SIGQUIT, sighandle);
|
||||
#endif
|
||||
|
|
@ -636,5 +639,8 @@ Init_signal()
|
|||
#ifdef SIGSEGV
|
||||
ruby_signal(SIGSEGV, sigsegv);
|
||||
#endif
|
||||
#ifdef SIGPIPE
|
||||
ruby_signal(SIGPIPE, SIG_IGN);
|
||||
#endif
|
||||
#endif /* MACOS_UNUSE_SIGNAL */
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue