diff options
author | dormando <dormando@rydia.net> | 2023-02-01 13:09:14 -0800 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2023-02-01 13:09:14 -0800 |
commit | 0d8ebbfb823c94e5ce68550c9ae186d8af789446 (patch) | |
tree | 994f030dd323836ec11a331970261e579cc25f2f /timedrun.c | |
parent | 0503e4fb125cee5d8711229ee07e561f9fb36bc3 (diff) | |
download | memcached-0d8ebbfb823c94e5ce68550c9ae186d8af789446.tar.gz |
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.
Diffstat (limited to 'timedrun.c')
-rw-r--r-- | timedrun.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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 */ |