From 02f5def4490f7e12987b0cf77989d42045627df5 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Tue, 11 Dec 2007 17:42:24 +0100 Subject: [PATCH] Fix SIGUSR1 handling on Solaris. para_client dies the second time it receives SIGUSR1, because the signal action is restored to the default state once the signal handler has been called. --- command.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/command.c b/command.c index 68cc5ab5..d35113a5 100644 --- a/command.c +++ b/command.c @@ -40,8 +40,16 @@ static unsigned char rc4_buf[2 * RC4_KEY_LEN]; extern struct misc_meta_data *mmd; extern struct sender senders[]; -static void dummy(__a_unused int s) -{} +static void dummy(int s) +{ + /* + * At least on Solaris, SIGUSR1 is one-shot, i.e. the signal action is + * restored to the default state once the signal handler has been + * called. + */ + if (s == SIGUSR1) + signal(SIGUSR1, dummy); +} static void mmd_dup(struct misc_meta_data *new_mmd) { -- 2.30.2