GNU bug report logs -
#68708
[PATCH] env,kill: Handle unnamed signals
Previous Next
Reported by: Grisha Levit <grishalevit <at> gmail.com>
Date: Thu, 25 Jan 2024 04:35:02 UTC
Severity: normal
Tags: notabug, patch
Done: Grisha Levit <grishalevit <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
On 25/01/2024 19:52, Grisha Levit wrote:
>> On Thu, Jan 25, 2024, 09:50 Pádraig Brady <P <at> draigbrady.com> wrote:
>> This mostly looks good, except:
>>
>> - No need to clear the errno before kill(3).
>> - Better to use SIG%d rather than the bare %d for signal _names_, as we already parse this format
>
> Makes sense, done below.
>
> * src/operand2sig.c (operand2sig): Drop signame argument, accept all
> signal numbers <= SIGNUM_BOUND. All callers updated.
> * src/env.c (parse_signal_action_params, reset_signal_handlers)
> (parse_block_signal_params, set_signal_proc_mask)
> (list_signal_handling): Accept all signal numbers <= SIGNUM_BOUND,
> use SIG%d for printing if necessary.
> * src/kill.c (list_signals, main): Likewise.
> (send_signals): Check errno from kill(3) for bad signo.
> * src/timeout.c (main): Update operand2sig call.
> * tests/misc/kill.sh: Test listing all signal numbers.
I've made a few adjustments:
- Clarified the commit message.
- I've gone back to have kill -l produce a bare number for unnamed signals, because:
this is consistent with util-linux,
SIG%d is only parseable by coreutils (not util-linux or bash),
easier to programatically determine if a name is defined.
I've left as SIG%d for -t output as that's a coreutils specific option,
and not really programatically consumable anyway.
- I've added a validation check for `env --block=32` so that it fails
like `env --default=32` and `env --ignore=32`.
I.e. exits with EXIT_CANCELED.
- Added a NEWS entry.
I'll apply this later.
thanks!
Pádraig
[0001-env-kill-timeout-support-unnamed-signals.patch (text/x-patch, attachment)]
This bug report was last modified 1 year and 69 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.