On Tue, 2021-10-12 at 14:50 +0100, Pádraig Brady wrote:
> That is a fair point.

Thanks for reconsidering :-)


> If one is using --kill-after you have to
> check for both 124 and 137 anyway to see if it timed out.
> It is useful to know whether the command was forcably killed.
> Using --foreground to avoid the 137 exit status upon --kill-after
> is not until now documented, so we should probably adjust
> the exit status to be always 137 if a SIGKILL is sent.
> 
> With the attached we now behave like:
> 
>    $ timeout -v -s0 --foreground -k2 1 sleep 3; echo $?
>    timeout: sending signal EXIT to command ‘sleep’
>    timeout: sending signal KILL to command ‘sleep’
>    137
> 
>    $ timeout -v -s0 -k2 1 sleep 3; echo $?
>    timeout: sending signal EXIT to command ‘sleep’
>    timeout: sending signal KILL to command ‘sleep’
>    Killed
>    137

Great :-)


Cheers,
Chris.



Reply via email to