summaryrefslogtreecommitdiff
path: root/timedrun.c
diff options
context:
space:
mode:
authordormando <dormando@rydia.net>2023-02-01 13:09:14 -0800
committerdormando <dormando@rydia.net>2023-02-01 13:09:14 -0800
commit0d8ebbfb823c94e5ce68550c9ae186d8af789446 (patch)
tree994f030dd323836ec11a331970261e579cc25f2f /timedrun.c
parent0503e4fb125cee5d8711229ee07e561f9fb36bc3 (diff)
downloadmemcached-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.c10
1 files changed, 10 insertions, 0 deletions
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 */