]> git.ipfire.org Git - thirdparty/util-linux.git/commit
script: do not try to close stderr twice
authorSami Kerola <kerolasa@iki.fi>
Tue, 6 Nov 2012 21:14:14 +0000 (21:14 +0000)
committerKarel Zak <kzak@redhat.com>
Thu, 8 Nov 2012 13:51:20 +0000 (14:51 +0100)
commit958e39d238fa8d880d1dda963c7f0fcd264c0f61
tree8310c5bbcfa5daff6d48d07645bbfc443383d0c2
parent3da7f698c17f64512994593e9c368181d4c52488
script: do not try to close stderr twice

The commit cdd2a8c360c70d16804ace7cc923a6c6bb7c9ca9 broke script(1)
return value.

$ script -e -c "echo"; echo $?
1

The reason, as Daniel it reported, was that the script will close stderr
twice, once as timing file and atexit() in function close_stdout().  This
commit fixes the problem.

Reported-by: Daniel Narvaez <dwnarvaez@gmail.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
term-utils/script.c