svn commit: r234073 - stable/9/lib/libthr/thread

Jilles Tjoelker jilles at FreeBSD.org
Mon Apr 9 22:01:44 UTC 2012


Author: jilles
Date: Mon Apr  9 22:01:43 2012
New Revision: 234073
URL: http://svn.freebsd.org/changeset/base/234073

Log:
  MFC r233516: 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.

Modified:
  stable/9/lib/libthr/thread/thr_sig.c
Directory Properties:
  stable/9/lib/libthr/   (props changed)

Modified: stable/9/lib/libthr/thread/thr_sig.c
==============================================================================
--- stable/9/lib/libthr/thread/thr_sig.c	Mon Apr  9 21:58:58 2012	(r234072)
+++ stable/9/lib/libthr/thread/thr_sig.c	Mon Apr  9 22:01:43 2012	(r234073)
@@ -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));
 }
 


More information about the svn-src-stable-9 mailing list