From owner-freebsd-hackers@FreeBSD.ORG Wed Mar 10 20:04:11 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 71B6E1065673; Wed, 10 Mar 2010 20:04:11 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id 12DCD8FC18; Wed, 10 Mar 2010 20:04:11 +0000 (UTC) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 22BE21CD0C; Wed, 10 Mar 2010 21:04:10 +0100 (CET) Date: Wed, 10 Mar 2010 21:04:10 +0100 From: Ed Schouten To: Alfred Perlstein Message-ID: <20100310200410.GG8200@hoeg.nl> References: <20100310093001.GL22317@elvis.mu.org> <20100310184152.GF8200@hoeg.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+n6TW4Th6de8VKLL" Content-Disposition: inline In-Reply-To: <20100310184152.GF8200@hoeg.nl> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: FreeBSD Hackers Subject: Re: tty or script(1) weirdness? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Mar 2010 20:04:11 -0000 --+n6TW4Th6de8VKLL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * 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 =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 204965) +++ script.c (working copy) @@ -158,6 +158,8 @@ } if (child =3D=3D 0) doshell(argv); + else + close(slave); =20 if (flushtime > 0) tvp =3D &tv; %%% --=20 Ed Schouten WWW: http://80386.nl/ --+n6TW4Th6de8VKLL Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkuX+zoACgkQ52SDGA2eCwVbYwCfUTBou5Vzo+E4KNt9YHYiNACh OJAAniGffxBvByrof+uLZhqp+Pix6Bzg =9+gw -----END PGP SIGNATURE----- --+n6TW4Th6de8VKLL--