]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
Fixed compilation when there's no sigwaitinfo
authorJean-Michel Vourgère <nirgal@debian.org>
Wed, 26 Aug 2015 10:10:59 +0000 (12:10 +0200)
committerTobias Oetiker <tobi@oetiker.ch>
Mon, 23 Nov 2015 11:13:22 +0000 (12:13 +0100)
* 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 b8e64c05b0899f6b64c765ec8fefc6be49aeadc1..e94d1d70c93bc3109715d970a8396837bc9b21ad 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
     }
   }