git: timeout(1): Also send SIGCONT because the child may be stopped

Aaron LI aly at crater.dragonflybsd.org
Tue Mar 18 19:35:54 PDT 2025


commit 253255fd86ebb0f8ae6d93f13e4daa6d3e16421d
Author: Aaron LI <aly at aaronly.me>
Date:   Sat Mar 1 23:39:00 2025 +0800

    timeout(1): Also send SIGCONT because the child may be stopped
    
    The POSIX.1-2024 says:
    
    "If the subsequent wait status of the child process shows that it was
    stopped by a signal, a SIGCONT signal shall also be sent in the same
    manner as the first signal; otherwise, a SIGCONT signal may be sent in
    the same manner."
    
    As it's allowed by the standard, we just always send the SIGCONT signal
    to the child process regardless of its stop state, so that timeout could
    terminate a stopped child.
    
    Test case (before this commit)
    ------------------------------
    $ timeout 5 grdc &
    [1] 13390
    $ fg
    timeout -v 5 grdc
    
    (just stuck)
    ------------------------------
    
    Reference: https://pubs.opengroup.org/onlinepubs/9799919799/utilities/timeout.html

Summary of changes:
 usr.bin/timeout/timeout.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/253255fd86ebb0f8ae6d93f13e4daa6d3e16421d


-- 
DragonFly BSD source repository


More information about the Commits mailing list