From owner-svn-src-head@FreeBSD.ORG Thu Mar 11 11:09:59 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04FBE1065677; Thu, 11 Mar 2010 11:09:59 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E8EEF8FC0C; Thu, 11 Mar 2010 11:09:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2BB9wR5067792; Thu, 11 Mar 2010 11:09:58 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2BB9wki067790; Thu, 11 Mar 2010 11:09:58 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201003111109.o2BB9wki067790@svn.freebsd.org> From: Ed Schouten Date: Thu, 11 Mar 2010 11:09:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205008 - head/usr.bin/script X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Mar 2010 11:09:59 -0000 Author: ed Date: Thu Mar 11 11:09:58 2010 New Revision: 205008 URL: http://svn.freebsd.org/changeset/base/205008 Log: Make script(1) a little less broken. Close the file descriptor to the TTY. There is no reason why the parent process should keep track of the descriptor. This ensures that the application inside properly drains the TTY during exit(2). Reported by: alfred MFC after: 2 weeks Modified: head/usr.bin/script/script.c Modified: head/usr.bin/script/script.c ============================================================================== --- head/usr.bin/script/script.c Thu Mar 11 08:58:13 2010 (r205007) +++ head/usr.bin/script/script.c Thu Mar 11 11:09:58 2010 (r205008) @@ -158,6 +158,8 @@ main(int argc, char *argv[]) } if (child == 0) doshell(argv); + else + close(slave); if (flushtime > 0) tvp = &tv;