summaryrefslogtreecommitdiff
path: root/signal.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-21 05:10:14 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-21 05:10:14 (GMT)
commite8bd56f5c34689d1211552863359a219ba2fce7e (patch)
treea200d085097b0d8e0cf74be7852b3f82b787653d /signal.c
parentc7b257717823607877cfdcf45d9e224541682f41 (diff)
signal.c: SIGEXIT is not a system signal
* signal.c (trap): SIGEXIT is not a system signal and is dealt with internally, so it should not try to register the system signal handler by sigaction. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47669 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'signal.c')
-rw-r--r--signal.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/signal.c b/signal.c
index feba176..4099a5d 100644
--- a/signal.c
+++ b/signal.c
@@ -1089,8 +1089,13 @@ trap(int sig, sighandler_t func, VALUE command)
* atomically. In current implementation, we only need to don't call
* RUBY_VM_CHECK_INTS().
*/
- oldfunc = ruby_signal(sig, func);
- if (oldfunc == SIG_ERR) rb_sys_fail_str(rb_signo2signm(sig));
+ if (sig == 0) {
+ oldfunc = SIG_ERR;
+ }
+ else {
+ oldfunc = ruby_signal(sig, func);
+ if (oldfunc == SIG_ERR) rb_sys_fail_str(rb_signo2signm(sig));
+ }
oldcmd = vm->trap_list[sig].cmd;
switch (oldcmd) {
case 0: