Actions
Bug #10866
closedA signal handler in signal.c can corrupt the value of errno.
    Bug #10866:
    A signal handler in signal.c can corrupt the value of errno.
  
Description
A signal handler in signal.c can corrupt the value of errno.  This is
common mistake.  It should save and restore errno as in the following
patch.  I think this is the only signal handler used but I am not that
familiar with the code.
Index: signal.c¶
--- signal.c	(revision 49641)
+++ signal.c	(working copy)
@@ -688,11 +688,15 @@
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
Actions