[前][次][番号順一覧][スレッド一覧]

ruby-changes:37665

From: normal <ko1@a...>
Date: Wed, 25 Feb 2015 18:17:32 +0900 (JST)
Subject: [ruby-changes:37665] normal:r49746 (trunk): signal.c: preserve errno

normal	2015-02-25 18:17:17 +0900 (Wed, 25 Feb 2015)

  New Revision: 49746

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=49746

  Log:
    signal.c: preserve errno
    
    * signal.c (sighandler): preserve errno
      Patch by Steven Stewart-Gallus <sstewartgallus00@m...>
      [ruby-core:68172] [Bug #10866]

  Modified files:
    trunk/ChangeLog
    trunk/signal.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 49745)
+++ ChangeLog	(revision 49746)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Feb 25 18:12:11 2015  Eric Wong  <e@8...>
+
+	* signal.c (sighandler): preserve errno
+	  Patch by Steven Stewart-Gallus <sstewartgallus00@m...>
+	  [ruby-core:68172] [Bug #10866]
+
 Wed Feb 25 15:59:35 2015  Nobuyoshi Nakada  <nobu@r...>
 
 	* dir.c (push_pattern, push_glob): make globbed file names same
Index: signal.c
===================================================================
--- signal.c	(revision 49745)
+++ signal.c	(revision 49746)
@@ -691,11 +691,15 @@ signal_enque(int sig) https://github.com/ruby/ruby/blob/trunk/signal.c#L691
 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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]