From amdmi3@amdmi3.ru  Fri Apr 30 19:48:57 2010
Return-Path: <amdmi3@amdmi3.ru>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 0D942106566C
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 30 Apr 2010 19:48:57 +0000 (UTC)
	(envelope-from amdmi3@amdmi3.ru)
Received: from smtp.timeweb.ru (smtp.timeweb.ru [92.53.116.15])
	by mx1.freebsd.org (Postfix) with ESMTP id BE3F68FC1E
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 30 Apr 2010 19:48:56 +0000 (UTC)
Received: from [213.148.20.85] (helo=hive.panopticon)
	by smtp.timeweb.ru with esmtpsa (TLSv1:CAMELLIA256-SHA:256)
	(Exim 4.71)
	(envelope-from <amdmi3@amdmi3.ru>)
	id 1O7wCk-0003tx-2S; Fri, 30 Apr 2010 23:48:54 +0400
Received: from hades.panopticon (hades.panopticon [192.168.0.32])
	by hive.panopticon (Postfix) with ESMTP id 02C8AB856;
	Fri, 30 Apr 2010 23:48:50 +0400 (MSD)
Received: by hades.panopticon (Postfix, from userid 1000)
	id F1B76B829; Fri, 30 Apr 2010 23:48:49 +0400 (MSD)
Message-Id: <20100430194849.GD90978@hades.panopticon>
Date: Fri, 30 Apr 2010 23:48:49 +0400
From: Dmitry Marakasov <amdmi3@amdmi3.ru>
To: Ed Schouten <ed@80386.nl>
Cc: FreeBSD-gnats-submit@freebsd.org
In-Reply-To: <20100430190515.GN56080@hoeg.nl>
Subject: Re: /usr/bin/script broken in HEAD and 8-STABLE
References: <20100430150856.06512B829@hades.panopticon>
 <20100430190515.GN56080@hoeg.nl>

>Number:         146198
>Category:       bin
>Synopsis:       Re: /usr/bin/script broken in HEAD and 8-STABLE
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Apr 30 19:50:07 UTC 2010
>Closed-Date:    Sat May 01 11:15:43 UTC 2010
>Last-Modified:  Sat May 01 11:15:43 UTC 2010
>Originator:     
>Release:        
>Organization:
>Environment:
>Description:
 * Ed Schouten (ed@80386.nl) wrote:
 
 > > After these changes it no longer exits with the same exit code as the command it runs (thus, if the command fails, it'll still exit with 0)
 > > Among other things, this breaks portupgrade, as it now mistakingly interprets failed port builds as successfull ones, thus removing ports without installing newer versions.
 > 
 > Looks like my fix is correct, but it did expose a new bug inside
 > script(1). We must not use WNOHANG in wait3(), because we must now
 > really wait for the child process to properly shut down.
 > 
 > Index: script.c
 > ===================================================================
 > --- script.c    (revision 207446)
 > +++ script.c    (working copy)
 > @@ -223,7 +223,7 @@
 >         int die, e, status;
 > 
 >         die = e = 0;
 > -       while ((pid = wait3(&status, WNOHANG, 0)) > 0)
 > +       while ((pid = wait3(&status, 0, 0)) > 0)
 >                 if (pid == child) {
 >                         die = 1;
 >                         if (WIFEXITED(status))
 > 
 
 This seems to work, thanks!
 
 -- 
 Dmitry Marakasov   .   55B5 0596 FF1E 8D84 5F56  9510 D35A 80DD F9D2 F77D
 amdmi3@amdmi3.ru  ..:  jabber: amdmi3@jabber.ru    http://www.amdmi3.ru
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: linimon 
State-Changed-When: Sat May 1 11:15:16 UTC 2010 
State-Changed-Why:  
Misfiled followup to bin/146189; content migrated. 


Responsible-Changed-From-To: gnats-admin->freebsd-bugs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sat May 1 11:15:16 UTC 2010 
Responsible-Changed-Why:  

http://www.freebsd.org/cgi/query-pr.cgi?pr=146198 
>Unformatted:
