logo

utils-std

Collection of commonly available Unix tools git clone https://anongit.hacktivis.me/git/utils-std.git
commit: 734299a6953f340d05f2ab99133267c34eb22b3e
parent df086bb16609a24db947ec19a6ddd1e97317505c
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Sat, 28 Sep 2024 19:57:00 +0200

cmd/timeout: use _Exit in handle_sigchld to avoid hangs from atexit

Diffstat:

Mcmd/timeout.c5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/cmd/timeout.c b/cmd/timeout.c @@ -35,7 +35,10 @@ handle_sigchld(int sig) (void)sig; int stat_loc = 0; waitpid(child, &stat_loc, WNOHANG); - exit(WEXITSTATUS(stat_loc)); + + // Not exit() to avoid running the atexit handlers + // one of which being gcc --coverage handler which causes a hang + _Exit(WEXITSTATUS(stat_loc)); } static void