]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/commit
MFC r225809:
authortrociny <trociny@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 4 Oct 2011 11:08:31 +0000 (11:08 +0000)
committertrociny <trociny@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 4 Oct 2011 11:08:31 +0000 (11:08 +0000)
commitb7ba8b62108972590e237c39462ea48899c49f3a
treeb11446d7a30a6514734ddaf478bcbffd96d628b2
parent8b499c68fa8775d1123ef44639b088a6e5b8420c
MFC r225809:

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>

git-svn-id: svn://svn.freebsd.org/base/stable/8@225966 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
usr.bin/script/script.1
usr.bin/script/script.c