From owner-cvs-src@FreeBSD.ORG Sun Feb 15 09:30:17 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 27D0516A4CE; Sun, 15 Feb 2004 09:30:17 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id CB5FD43D1D; Sun, 15 Feb 2004 09:30:13 -0800 (PST) (envelope-from cperciva@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i1FHUDGe027290; Sun, 15 Feb 2004 09:30:13 -0800 (PST) (envelope-from cperciva@repoman.freebsd.org) Received: (from cperciva@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i1FHUDFd027289; Sun, 15 Feb 2004 09:30:13 -0800 (PST) (envelope-from cperciva) Message-Id: <200402151730.i1FHUDFd027289@repoman.freebsd.org> From: Colin Percival Date: Sun, 15 Feb 2004 09:30:13 -0800 (PST) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/usr.bin/script script.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2004 17:30:17 -0000 cperciva 2004/02/15 09:30:13 PST FreeBSD src repository Modified files: usr.bin/script script.c Log: Attempt #2 to fix script(1) if the standard input is closed: If we read EOF from STDIN_FILENO, write zero bytes into the pseudo-terminal; this is interpreted as an EOF by the program being scripted. I've tested this with two non-interactive scripts: # echo 5 | script foo sh -c 'read x; sleep $x; echo bar' # echo bar | xargs script foo echo and one interactive program: # script foo more /etc/passwd and everything seems to work properly... PR: bin/56166, bin/57414, ports/57415, ports/60534 Approved by: rwatson (mentor) MFC after: 2 weeks Revision Changes Path 1.24 +3 -1 src/usr.bin/script/script.c