From owner-cvs-src-old@FreeBSD.ORG Tue Apr 6 05:20:53 2010 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26BE61065680 for ; Tue, 6 Apr 2010 05:20:53 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 11AAA8FC0C for ; Tue, 6 Apr 2010 05:20:53 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id o365KqpT076396 for ; Tue, 6 Apr 2010 05:20:52 GMT (envelope-from dougb@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id o365Kqvd076395 for cvs-src-old@freebsd.org; Tue, 6 Apr 2010 05:20:52 GMT (envelope-from dougb@repoman.freebsd.org) Message-Id: <201004060520.o365Kqvd076395@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to dougb@repoman.freebsd.org using -f From: Doug Barton Date: Tue, 6 Apr 2010 05:20:46 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/etc rc.subr X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Apr 2010 05:20:53 -0000 dougb 2010-04-06 05:20:46 UTC FreeBSD src repository Modified files: etc rc.subr Log: SVN rev 206248 on 2010-04-06 05:20:46Z by dougb In wait_for_pids(), pwait(1) can return when the process exits, but still exists as a zombie. The 'kill -0' test in this function can therefore return true even if the process isn't actually running. This could lead to wait_for_pids() printing an endless string of the pid number until the zombie finally exits. Solve this problem by moving the sleep up to after the 'kill -0' test, but only after we've run through the function once already. In the common case (only one pid in the list) this will always do the right thing. On the rare occasion that there is more than one pid in the list this will sleep 1 second per zombie process which will allow that process, and any other in the list a chance to exit. While I'm here, local'ize the variables that this function uses. Revision Changes Path 1.100 +4 -1 src/etc/rc.subr