]> git.ipfire.org Git - thirdparty/coreutils.git/commit
tee: avoid undefined behavior after fclose()
authorPádraig Brady <P@draigBrady.com>
Mon, 13 Mar 2023 21:26:21 +0000 (21:26 +0000)
committerPádraig Brady <P@draigBrady.com>
Mon, 13 Mar 2023 21:26:21 +0000 (21:26 +0000)
commit73d372dcc166afc387b4d130ecc00e5dce1fc89a
treea747b30181005d03df9253c1672a16691156c4f3
parentf26af5983313f1f4cf04143cecee68551ed6502f
tee: avoid undefined behavior after fclose()

* iopoll.c (fclose_wait): Rename from confusing fclose_nonblock name.
Also adjust to do no operations on the stream after fclose()
as this is undefined. Instead use fflush() to determine EAGAIN status.
(fwrite_wait): Renamed from confusing fwrite_nonblock name.
src/iopoll.c
src/iopoll.h
src/tee.c