summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-25 09:17:17 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-25 09:17:17 +0000
commitbe5b7f61307c6caaafb7a760b29f3c2b3dee9dfb (patch)
treed4ed6ca1ee27b1c0446b3aa8567b19c5f1ab2550
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
-rw-r--r--ChangeLog6
-rw-r--r--signal.c4
2 files changed, 10 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index df5bdad..ed7c146 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Wed Feb 25 18:12:11 2015 Eric Wong <e@80x24.org>
+
+ * signal.c (sighandler): preserve errno
+ Patch by Steven Stewart-Gallus <sstewartgallus00@mylangara.bc.ca>
+ [ruby-core:68172] [Bug #10866]
+
Wed Feb 25 15:59:35 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
* dir.c (push_pattern, push_glob): make globbed file names same
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