Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Oct 2011 05:50:16 GMT
From:      dfilter@FreeBSD.ORG (dfilter service)
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/161526: commit references a PR
Message-ID:  <201110210550.p9L5oGOP097834@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/161526; it has been noted by GNATS.

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/161526: commit references a PR
Date: Fri, 21 Oct 2011 05:42:32 +0000 (UTC)

 Author: trociny
 Date: Fri Oct 21 05:41:20 2011
 New Revision: 226593
 URL: http://svn.freebsd.org/changeset/base/226593
 
 Log:
   MFC r226403:
   
   In r225809 the intention was to send VEOF only once if STDIN was not a
   terminal. Unfortunately the fix was incorrect and for flushtime > 0 it
   keept sending VEOF.
   
   Sent VEOF generates ^D\b\b echoed by the terminal, which was reported
   in bin/161526. Note, we still send VEOF at least once. Otherwise
   commands like below would hang forever:
   
     echo 1 |script /tmp/script.out cat
   
   PR:		bin/161526
   Reported by:	Adrian Wontroba <aw1@stade.co.uk>, Stefan Bethke <stb@lassitu.de>
   Tested by:	Stefan Bethke <stb@lassitu.de>
 
 Modified:
   stable/7/usr.bin/script/script.c
 Directory Properties:
   stable/7/usr.bin/script/   (props changed)
 
 Modified: stable/7/usr.bin/script/script.c
 ==============================================================================
 --- stable/7/usr.bin/script/script.c	Fri Oct 21 05:40:30 2011	(r226592)
 +++ stable/7/usr.bin/script/script.c	Fri Oct 21 05:41:20 2011	(r226593)
 @@ -167,12 +167,15 @@ main(int argc, char *argv[])
  		FD_SET(master, &rfd);
  		if (readstdin)
  			FD_SET(STDIN_FILENO, &rfd);
 -		if ((!readstdin && ttyflg) || flushtime > 0) {
 -			tv.tv_sec = !readstdin && ttyflg ? 1 :
 -			    flushtime - (tvec - start);
 +		if (!readstdin && ttyflg) {
 +			tv.tv_sec = 1;
  			tv.tv_usec = 0;
  			tvp = &tv;
  			readstdin = 1;
 +		} else if (flushtime > 0) {
 +			tv.tv_sec = flushtime - (tvec - start);
 +			tv.tv_usec = 0;
 +			tvp = &tv;
  		} else {
  			tvp = NULL;
  		}
 _______________________________________________
 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"
 



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