aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--signal.c4
2 files changed, 10 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index df5bdadece..ed7c146799 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 f64c24c599..fcfed8d42e 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