From ed@hoeg.nl  Fri Apr 30 19:25:05 2010
Return-Path: <ed@hoeg.nl>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id C7A461065670;
	Fri, 30 Apr 2010 19:25:05 +0000 (UTC)
	(envelope-from ed@hoeg.nl)
Received: from mx0.hoeg.nl (mx0.hoeg.nl [178.63.0.170])
	by mx1.freebsd.org (Postfix) with ESMTP id 469EE8FC0A;
	Fri, 30 Apr 2010 19:25:05 +0000 (UTC)
Received: by mx0.hoeg.nl (Postfix, from userid 1000)
	id 3CEE32A28CF4; Fri, 30 Apr 2010 21:05:15 +0200 (CEST)
Message-Id: <20100430190515.GN56080@hoeg.nl>
Date: Fri, 30 Apr 2010 21:05:15 +0200
From: Ed Schouten <ed@80386.nl>
To: Dmitry Marakasov <amdmi3@FreeBSD.org>
Cc: FreeBSD-gnats-submit@freebsd.org
In-Reply-To: <20100430150856.06512B829@hades.panopticon>
Subject: Re: /usr/bin/script broken in HEAD and 8-STABLE
References: <20100430150856.06512B829@hades.panopticon>

>Number:         146196
>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:30:13 UTC 2010
>Closed-Date:    Sat May 01 11:15:11 UTC 2010
>Last-Modified:  Sat May 01 11:15:11 UTC 2010
>Originator:     
>Release:        
>Organization:
>Environment:
>Description:
 --wOOEd1gxhwV8K3c+
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
 * Dmitry Marakasov <amdmi3@FreeBSD.org> wrote:
 > After these changes it no longer exits with the same exit code as the com=
 mand it runs (thus, if the command fails, it'll still exit with 0)
 > Among other things, this breaks portupgrade, as it now mistakingly interp=
 rets failed port builds as successfull ones, thus removing ports without in=
 stalling 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
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 --- script.c    (revision 207446)
 +++ script.c    (working copy)
 @@ -223,7 +223,7 @@
         int die, e, status;
 
         die =3D e =3D 0;
 -       while ((pid =3D wait3(&status, WNOHANG, 0)) > 0)
 +       while ((pid =3D wait3(&status, 0, 0)) > 0)
                 if (pid =3D=3D child) {
                         die =3D 1;
                         if (WIFEXITED(status))
 
 --=20
  Ed Schouten <ed@80386.nl>
  WWW: http://80386.nl/
 
 --wOOEd1gxhwV8K3c+
 Content-Type: application/pgp-signature
 Content-Disposition: inline
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.14 (FreeBSD)
 
 iEYEARECAAYFAkvbKesACgkQ52SDGA2eCwWD+wCdH3TAsaJAerK8Id3lA818dl+8
 7ysAnjGAfsPJElI4PJsooEnXmeLOuKwl
 =xf5v
 -----END PGP SIGNATURE-----
 
 --wOOEd1gxhwV8K3c+--
>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:14:39 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:14:39 UTC 2010 
Responsible-Changed-Why:  

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