]> 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>
Fri, 16 Nov 2012 10:26:57 +0000 (11:26 +0100)
commit2198b363f07fb10bf54dd2d564ce1bb2981b5d25
tree3ab0ae2b18edcd6e1b061994e42088bebc86db30
parentcb187bc79c4e2166af391beb27f7bb05967fa08e
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