From owner-freebsd-bugs@FreeBSD.ORG Sun May 31 19:40:03 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CEC5106566B for ; Sun, 31 May 2009 19:40:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 3F4728FC14 for ; Sun, 31 May 2009 19:40:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n4VJe3u1064778 for ; Sun, 31 May 2009 19:40:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n4VJe3ZJ064777; Sun, 31 May 2009 19:40:03 GMT (envelope-from gnats) Date: Sun, 31 May 2009 19:40:03 GMT Message-Id: <200905311940.n4VJe3ZJ064777@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: dfilter@FreeBSD.ORG (dfilter service) Cc: Subject: Re: bin/129566: commit references a PR X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: dfilter service List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 19:40:03 -0000 The following reply was made to PR bin/129566; it has been noted by GNATS. From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: bin/129566: commit references a PR Date: Sun, 31 May 2009 19:37:26 +0000 (UTC) Author: jilles Date: Sun May 31 19:37:06 2009 New Revision: 193185 URL: http://svn.freebsd.org/changeset/base/193185 Log: sh: Make read's timeout (-t) apply to the entire line, not only the first character. This avoids using non-standard behaviour of the old (upto FreeBSD 7) TTY layer: it reprocesses the input queue when switching to canonical mode. The new TTY layer does not provide this functionality and so read -t worked very poorly (first character is not echoed, cannot be backspaced but is still read). This also agrees with what most other shells with read -t do. PR: bin/129566 Reviewed by: stefanf Approved by: ed (mentor) Modified: head/bin/sh/miscbltin.c head/bin/sh/sh.1 Modified: head/bin/sh/miscbltin.c ============================================================================== --- head/bin/sh/miscbltin.c Sun May 31 19:35:41 2009 (r193184) +++ head/bin/sh/miscbltin.c Sun May 31 19:37:06 2009 (r193185) @@ -103,8 +103,6 @@ readcmd(int argc __unused, char **argv _ struct timeval tv; char *tvptr; fd_set ifds; - struct termios told, tnew; - int tsaved; rflag = 0; prompt = NULL; @@ -151,26 +149,11 @@ readcmd(int argc __unused, char **argv _ if (tv.tv_sec >= 0) { /* - * See if we can disable input processing; this will - * not give the desired result if we are in a pipeline - * and someone upstream is still in line-by-line mode. - */ - tsaved = 0; - if (tcgetattr(0, &told) == 0) { - memcpy(&tnew, &told, sizeof(told)); - cfmakeraw(&tnew); - tnew.c_iflag |= told.c_iflag & ICRNL; - tcsetattr(0, TCSANOW, &tnew); - tsaved = 1; - } - /* * Wait for something to become available. */ FD_ZERO(&ifds); FD_SET(0, &ifds); status = select(1, &ifds, NULL, NULL, &tv); - if (tsaved) - tcsetattr(0, TCSANOW, &told); /* * If there's nothing ready, return an error. */ Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Sun May 31 19:35:41 2009 (r193184) +++ head/bin/sh/sh.1 Sun May 31 19:37:06 2009 (r193185) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd October 7, 2006 +.Dd May 31, 2009 .Dt SH 1 .Os .Sh NAME @@ -1949,7 +1949,7 @@ If the .Fl t option is specified and the .Ar timeout -elapses before any input is supplied, +elapses before a complete line of input is supplied, the .Ic read command will return an exit status of 1 without assigning any values. _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"