Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Mar 2012 17:05:27 +0000 (UTC)
From:      Jilles Tjoelker <jilles@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r233516 - head/lib/libthr/thread
Message-ID:  <201203261705.q2QH5RPI042462@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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));
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203261705.q2QH5RPI042462>