Date: Tue, 13 Apr 2010 20:36:54 +0000 (UTC) From: Doug Barton <dougb@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r206565 - stable/8/etc Message-ID: <201004132036.o3DKasKA058229@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 "."
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201004132036.o3DKasKA058229>