]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
Fixed compilation when there's no sigwaitinfo 665/head
authorJean-Michel Vourgère <nirgal@debian.org>
Wed, 26 Aug 2015 10:10:59 +0000 (12:10 +0200)
committerJean-Michel Vourgère <nirgal@debian.org>
Wed, 26 Aug 2015 10:10:59 +0000 (12:10 +0200)
* Fixed pointer in call to sigwait
* Don't print pid when we don't have it
* Fixed unused variable warning

src/rrd_daemon.c

index 4a2fb1c52246b2918bd03ac8c3bfcdad2a7fec73..423fcb16496fc28311a4a49a31b42303fe0b879b 100644 (file)
@@ -335,16 +335,16 @@ static void sig_common (const char *sig) /* {{{ */
 
 static void* signal_receiver (void UNUSED(*args))
 {
-  siginfo_t signal_info;
   int status;
 
   while (1)
   {
 #if defined(HAVE_SIGWAITINFO)
+    siginfo_t signal_info;
     status = sigwaitinfo(&signal_set, &signal_info);
 #elif defined(HAVE_SIGWAIT)
     status = -1;
-    if (sigwait(signal_set, &status) < 0 ){
+    if (sigwait(&signal_set, &status) < 0 ){
        status = -1;
     }
 #else
@@ -408,11 +408,18 @@ static void* signal_receiver (void UNUSED(*args))
         break;
 
       default:
+#if defined(HAVE_SIGWAITINFO)
         RRDD_LOG(LOG_NOTICE,
                  "%s: Signal %d was received from process %u.\n",
                  __func__,
                  status,
                  signal_info.si_pid);
+#else
+        RRDD_LOG(LOG_NOTICE,
+                 "%s: Signal %d was received.\n",
+                 __func__,
+                 status);
+#endif
     }
   }