Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Mar 2010 11:09:58 +0000 (UTC)
From:      Ed Schouten <ed@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r205008 - head/usr.bin/script
Message-ID:  <201003111109.o2BB9wki067790@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201003111109.o2BB9wki067790>