`signal_by_name_or_value()` only looked up signals from the static
ALL_SIGNALS array, which doesn't include realtime signals. This caused
`timeout -s RTMAX`, `kill -s RTMIN`, and `env --default-signal=RTMAX`
to reject valid signal names.
Extend the function to fall back to realtime_signal_bounds() for both
name lookups and numeric values in the realtime range, matching the
behavior already present in signal_list_value_by_name_or_number().
Also fix timeout's report_if_verbose() to use signal_list_name_by_value
instead of signal_name_by_value, so verbose output doesn't panic for
realtime signal numbers.
Fixes GNU test: tests/env/env-signal-handler.sh
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was quite a bunch of different features missing in timeout, to start off, now that we have a mechanism to read the SIGPIPE handlers before they are overwritten by the rust runtime, it means that we can not propagate this signal down to the child processes if the signal is set to ignore.
This also includes all of the latest changes since 9.9 where the specific signal sent to timeout will be propagated instead of just defaulting to a TERM signal.
- remove "WaitingFailed" which is a duplicate of "CommandTimedOut"
- replace hard-coded values 126 and 127 with enum values, remove TODO
- fix misleading comment. we DO return CommandTimedOut even when preserve-status is not specified
- add tests for exit values 126 and 127
Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
This FIXME comment was added in 2021 ( 5431e947bc ).
`timeout` is already in feat_require_unix_core, so having `true` and `false` on
the machine running the test is quite reasonable and does not warrant a FIXME.
Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>