svn commit: r206565 - stable/8/etc
Doug Barton
dougb at FreeBSD.org
Tue Apr 13 20:36:54 UTC 2010
Author: dougb
Date: Tue Apr 13 20:36:54 2010
New Revision: 206565
URL: http://svn.freebsd.org/changeset/base/206565
Log:
MFC r206248:
Change where we nap so that if pwait(1) returns but kill -0 still sees
a zombie we don't print an endless string of the same pid number until
the zombie exits.
While I'm here, local'ize the variables that this function uses.
Modified:
stable/8/etc/rc.subr
Directory Properties:
stable/8/etc/ (props changed)
Modified: stable/8/etc/rc.subr
==============================================================================
--- stable/8/etc/rc.subr Tue Apr 13 20:33:34 2010 (r206564)
+++ stable/8/etc/rc.subr Tue Apr 13 20:36:54 2010 (r206565)
@@ -372,6 +372,8 @@ _find_processes()
#
wait_for_pids()
{
+ local _list _prefix _nlist _j
+
_list="$@"
if [ -z "$_list" ]; then
return
@@ -382,6 +384,7 @@ wait_for_pids()
for _j in $_list; do
if kill -0 $_j 2>/dev/null; then
_nlist="${_nlist}${_nlist:+ }$_j"
+ [ -n "$_prefix" ] && sleep 1
fi
done
if [ -z "$_nlist" ]; then
@@ -390,7 +393,7 @@ wait_for_pids()
_list=$_nlist
echo -n ${_prefix:-"Waiting for PIDS: "}$_list
_prefix=", "
- pwait $_list 2>/dev/null || sleep 2
+ pwait $_list 2>/dev/null
done
if [ -n "$_prefix" ]; then
echo "."
More information about the svn-src-stable-8
mailing list