summaryrefslogtreecommitdiff
path: root/signal.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-25 09:17:17 (GMT)
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-25 09:17:17 (GMT)
commitbe5b7f61307c6caaafb7a760b29f3c2b3dee9dfb (patch)
treed4ed6ca1ee27b1c0446b3aa8567b19c5f1ab2550 /signal.c
parentf4726dcdaa421fa9bb2077b5de195acc5e3d4271 (diff)
signal.c: preserve errno
* signal.c (sighandler): preserve errno Patch by Steven Stewart-Gallus <sstewartgallus00@mylangara.bc.ca> [ruby-core:68172] [Bug #10866] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'signal.c')
-rw-r--r--signal.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/signal.c b/signal.c
index f64c24c..fcfed8d 100644
--- a/signal.c
+++ b/signal.c
@@ -691,11 +691,15 @@ signal_enque(int sig)
static RETSIGTYPE
sighandler(int sig)
{
+ int old_errnum = errno;
+
signal_enque(sig);
rb_thread_wakeup_timer_thread();
#if !defined(BSD_SIGNAL) && !defined(POSIX_SIGNAL)
ruby_signal(sig, sighandler);
#endif
+
+ errno = old_errnum;
}
int