summaryrefslogtreecommitdiff
path: root/signal.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-07 14:40:16 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-07 14:40:16 +0000
commit2ebafed88a665dcaaf4fb58b8c3fd0809db8fa2c (patch)
tree1675d20d6ce448f9a8c71387a29caa0b726c9e58 /signal.c
parent1bb2721e4be001cf92620fb20c6487cb7596d7fa (diff)
signal.c: get rid of deadlock by discarded signals
* signal.c (rb_f_kill): get rid of deadlock as unhandled and discarded signals do not make interrupt_cond signaled. based on the patch by Kazuki Tsujimoto at [ruby-dev:48606]. [Bug #9820] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'signal.c')
-rw-r--r--signal.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/signal.c b/signal.c
index 171f5ac971..c42ce0aee0 100644
--- a/signal.c
+++ b/signal.c
@@ -487,7 +487,8 @@ rb_f_kill(int argc, const VALUE *argv)
default:
t = signal_ignored(sig);
if (t) {
- if (t < 0) ruby_kill(pid, sig);
+ if (t < 0 && kill(pid, sig))
+ rb_sys_fail(0);
break;
}
signal_enque(sig);