freebsd-skq/usr.bin/script
Mikolaj Golub 29da75477b When script(1) reads EOF from input it starts spinning on zero-byte
reads eating 100% CPU. Fix this by skipping select on STDIN after
reading EOF -- permanently if STDIN is not terminal and for one second
if it is.

Also after reading EOF from STDIN we have to pass it to the program
being scripted. The previous approach was to write zero bytes into the
pseudo-terminal. This does not work because zero-byte write does not
have any effect on read. Fix this by sending VEOF instead.

Submitted by:	Ronald Klop <ronald-freebsd8@klop.yi.org>
Discussed with:	kib, Chris Torek <chris.torek@gmail.com>
Approved by:	kib
MFC after:	1 week
2011-09-27 18:14:04 +00:00
..
Makefile
script.1 When script(1) reads EOF from input it starts spinning on zero-byte 2011-09-27 18:14:04 +00:00
script.c When script(1) reads EOF from input it starts spinning on zero-byte 2011-09-27 18:14:04 +00:00