timeout: add --preserve-status to always propagate the exit status
authorÁngel González <keisial@gmail.com>
Mon, 29 Oct 2012 00:36:08 +0000 (00:36 +0000)
committerPádraig Brady <P@draigBrady.com>
Sun, 4 Nov 2012 01:48:14 +0000 (01:48 +0000)
commitde2397fece839ce90f71e0624f5435755ad9ea01
tree7fec66140c170279fa0de51e1ae747fa5a0a9ad3
parent8096ec664173f243e045be065203e6ad1aa1fa75
timeout: add --preserve-status to always propagate the exit status

It's useful for commands that support running for an indeterminite
amount of time, to not return a specific timeout exit status (124),
and instead let the command handle the timeout signal and return
a status for the work done so far.

* doc/coreutils.texi (timeout invocation): Describe the new option.
* src/timeout.c (preserve_status): A new global boolean to
enable the --preserve-status behavior.
(usage): Describe the new option.
(main): Don't return EXIT_TIMEOUT of preserve_status is set.
* tests/misc/timeout.sh: Add a test for the new option.
doc/coreutils.texi
src/timeout.c
tests/misc/timeout.sh