From 0d8ebbfb823c94e5ce68550c9ae186d8af789446 Mon Sep 17 00:00:00 2001 From: dormando Date: Wed, 1 Feb 2023 13:09:14 -0800 Subject: tests: timedrun SIGHUP pass-thru timedrun would attmept to exit after passing along any type of signal to the child. allow SIGHUP to pass and continue waiting. --- timedrun.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/timedrun.c b/timedrun.c index 28ce498..ca4eaae 100644 --- a/timedrun.c +++ b/timedrun.c @@ -44,6 +44,16 @@ static int wait_for_process(pid_t pid) break; } else { int sig = 0; + /* pass along SIGHUP gracefully */ + if (caught_sig == SIGHUP) { + i = 0; + int sig = caught_sig; + if (kill(pid, sig) < 0) { + /* Kill failed. Must have lost the process. :/ */ + perror("lost child when trying to kill"); + } + continue; + } switch (i) { case 0: /* On the first iteration, pass the signal through */ -- cgit v1.2.1