]> git.ipfire.org Git - thirdparty/coreutils.git/commit
timeout: prioritize "timed out" exit status
authorPádraig Brady <P@draigBrady.com>
Tue, 2 Dec 2025 17:15:06 +0000 (17:15 +0000)
committerPádraig Brady <P@draigBrady.com>
Tue, 2 Dec 2025 17:20:19 +0000 (17:20 +0000)
commit86061ddbbdb4194362ede72f9900297d8d31d051
tree6bbb5b3fcfe9f476a80f65c5b5d93e59177ab616
parent2d07c26d95f36b47ae969edbf83dbff3fed3f960
timeout: prioritize "timed out" exit status

* src/timeout.c (cleanup): Reset the default exit status
to EXIT_TIMEDOUT, if we have in fact received an ALARM.
Otherwise we would exit with status EXIT_CANCELED if
there was an issue writing --verbose output for example.
This also ensures a consistent exit status with ASAN enabled,
as with ASAN stderr is not explicitly closed by gnulib's
close_stdout handler.
src/timeout.c
tests/timeout/timeout.sh