From owner-freebsd-hackers@FreeBSD.ORG Thu Mar 11 10:57:49 2010 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA1B2106564A; Thu, 11 Mar 2010 10:57:49 +0000 (UTC) (envelope-from gary.jennejohn@freenet.de) Received: from mout0.freenet.de (mout0.freenet.de [IPv6:2001:748:100:40::2:2]) by mx1.freebsd.org (Postfix) with ESMTP id 747B28FC18; Thu, 11 Mar 2010 10:57:49 +0000 (UTC) Received: from [195.4.92.24] (helo=14.mx.freenet.de) by mout0.freenet.de with esmtpa (ID gary.jennejohn@freenet.de) (port 25) (Exim 4.72 #1) id 1Npg5M-0006e6-Ny; Thu, 11 Mar 2010 11:57:48 +0100 Received: from p57ae1b2e.dip0.t-ipconnect.de ([87.174.27.46]:55241 helo=ernst.jennejohn.org) by 14.mx.freenet.de with esmtpa (ID gary.jennejohn@freenet.de) (port 25) (Exim 4.72 #2) id 1Npg5M-0005vD-8z; Thu, 11 Mar 2010 11:57:48 +0100 Date: Thu, 11 Mar 2010 11:57:47 +0100 From: Gary Jennejohn To: Ed Schouten Message-ID: <20100311115747.1678c3dd@ernst.jennejohn.org> In-Reply-To: <20100310200410.GG8200@hoeg.nl> References: <20100310093001.GL22317@elvis.mu.org> <20100310184152.GF8200@hoeg.nl> <20100310200410.GG8200@hoeg.nl> X-Mailer: Claws Mail 3.7.4 (GTK+ 2.16.2; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: FreeBSD Hackers , Alfred Perlstein Subject: Re: tty or script(1) weirdness? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: gary.jennejohn@freenet.de List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Mar 2010 10:57:49 -0000 On Wed, 10 Mar 2010 21:04:10 +0100 Ed Schouten wrote: > * Ed Schouten wrote: > > Hmmm... It seems this is a TTY bug. When you close a TTY, the final > > close() call should get stuck until all data is actually drained. This > > doesn't seem to happen properly. > > Some further research: it's not a TTY bug, but a bug in script(1). > The script parent process leaves a file descriptor open, which means > output is never properly drained. > > I can't reproduce this issue after applying this patch: > > %%% > Index: script.c > =================================================================== > --- script.c (revision 204965) > +++ script.c (working copy) > @@ -158,6 +158,8 @@ > } > if (child == 0) > doshell(argv); > + else > + close(slave); > > if (flushtime > 0) > tvp = &tv; > %%% > Looks very convincing. I say commit it. --- Gary Jennejohn