Author: jilles
Date: Mon Mar 26 17:05:26 2012
New Revision: 233516
URL: http://svn.freebsd.org/changeset/base/233516

Log:
  libthr: In the atfork handlers for signals, do not skip the last signal.
  
  _SIG_MAXSIG works a bit unexpectedly: signals 1 till _SIG_MAXSIG are valid,
  both bounds inclusive.
  
  Reviewed by:  davidxu
  MFC after:    1 week

Modified:
  head/lib/libthr/thread/thr_sig.c

Modified: head/lib/libthr/thread/thr_sig.c
==============================================================================
--- head/lib/libthr/thread/thr_sig.c    Mon Mar 26 16:40:45 2012        
(r233515)
+++ head/lib/libthr/thread/thr_sig.c    Mon Mar 26 17:05:26 2012        
(r233516)
@@ -458,7 +458,7 @@ _thr_signal_prefork(void)
 {
        int i;
 
-       for (i = 1; i < _SIG_MAXSIG; ++i)
+       for (i = 1; i <= _SIG_MAXSIG; ++i)
                _thr_rwl_rdlock(&_thr_sigact[i-1].lock);
 }
 
@@ -467,7 +467,7 @@ _thr_signal_postfork(void)
 {
        int i;
 
-       for (i = 1; i < _SIG_MAXSIG; ++i)
+       for (i = 1; i <= _SIG_MAXSIG; ++i)
                _thr_rwl_unlock(&_thr_sigact[i-1].lock);
 }
 
@@ -476,7 +476,7 @@ _thr_signal_postfork_child(void)
 {
        int i;
 
-       for (i = 1; i < _SIG_MAXSIG; ++i)
+       for (i = 1; i <= _SIG_MAXSIG; ++i)
                bzero(&_thr_sigact[i-1].lock, sizeof(struct urwlock));
 }
 
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to