diff options
author | Karel Zak | 2016-04-13 11:52:43 +0200 |
---|---|---|
committer | Karel Zak | 2016-04-13 11:52:43 +0200 |
commit | b2bff0666101213d5ce9fc4166d8fc5b17581f57 (patch) | |
tree | 0dde8d72216fc84bfea4b0fbaee04c186c06784b /lib/canonicalize.c | |
parent | build-sys: release++ (v2.28) (diff) | |
download | kernel-qcow2-util-linux-b2bff0666101213d5ce9fc4166d8fc5b17581f57.tar.gz kernel-qcow2-util-linux-b2bff0666101213d5ce9fc4166d8fc5b17581f57.tar.xz kernel-qcow2-util-linux-b2bff0666101213d5ce9fc4166d8fc5b17581f57.zip |
script: use empty-slave heuristic more carefully
script(1) waits for empty slave FD (shell stdin) before it writes to
master. This feature has been intorduiced by 54c6611d6f7b73609a5331f4d0bcf63c4af6429e
to avoid misbehavior when we need to send EOF to the shell.
Unfortunately, this feature has been used all time for all messages.
This is wrong because command in the session (or shell) may ignore
stdin at all and wait forever in busy loop is really bad idea. Test
case:
script /dev/null
tailf /etc/passwd
<enter>
<enter>
... script process taking 100% CPU.
This patch forces script to use empty-stave detection only when we
need to write EOF. The busy loop has been modified to use nanosleep
and it does not wait forever...
Addresses: http://bugs.debian.org/820843
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'lib/canonicalize.c')
0 files changed, 0 insertions, 0 deletions