Fix SIGUSR1 handling on Solaris.
authorAndre Noll <maan@systemlinux.org>
Tue, 11 Dec 2007 16:42:24 +0000 (17:42 +0100)
committerAndre Noll <maan@systemlinux.org>
Tue, 11 Dec 2007 16:42:24 +0000 (17:42 +0100)
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

index 68cc5ab55f7c8da0362bb1ae9aa018014a97ede9..d35113a500f0a2b78ce853996db9413bafd0be4f 100644 (file)
--- 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[];
 
 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)
 {
 
 static void mmd_dup(struct misc_meta_data *new_mmd)
 {