Repository navigation
env: apply the signal options in the order they are given - #15208
Conversation
6e154f0 to
c688985
Compare
|
Hi @RenjiSann — a quick check on this proposal: is it something you'd like to take? Your comment about If there's no interest I'll go ahead and close it in ten days or so, no worries at all — I'd just rather keep the queue here tidy than leave it sitting. |
|
I have no other objection to the code :) However, maybe you could squash the second commit in the first, that'd help keeping a readable main branch ^^ |
c688985 to
0714c10
Compare
0714c10 to
bb2c094
Compare
|
linting CI is unhappy, you may want to fix that |
|
Squashed into a single commit as asked — the helper change is described in the body now instead of in a second commit. The tree is otherwise the one the green run describes; the commit was rebased onto |
GNU applies --default-signal, --ignore-signal and --block-signal in the order they appear on the command line, so the last one for a signal wins. uutils applied them in a fixed order (default, ignore, block) whatever their order, so `env --ignore-signal=INT --default-signal=INT --list-signal-handling` left INT ignored instead of default, and `--ignore-signal --default-signal=INT` also left INT ignored. The three options are now collected with the index clap gives each value and applied in the order given. An option without a value still applies to every signal. apply_signal_action now takes only the action kind and derives the handler inside, so the call sites no longer spell the match out.
fbdc86a to
8981684
Compare
|
The rebase onto
|
envapplied--default-signal,--ignore-signaland--block-signalin a fixed order, soenv --ignore-signal=INT --default-signal=INT --list-signal-handling trueleft INT ignored where GNU reportsDEFAULT, and--ignore-signal --default-signal=INTdid the same.The options are now applied in the order they are given, using the index clap records for each value. An option without a value still applies to every signal.
Closes #15187.
test_env_arg_ignore_signal_all_signalsandtest_env_arg_ignore_signal_valid_signalsfail on macOS here with and without this change (they send a signal right after spawning and assert the process is still alive); everything else intest_envpasses.