src/rrd_daemon.c: Mark another argument as being unused.
[rrdtool.git] / src / rrd_daemon.c
index 3af33dc..5f25e15 100644 (file)
@@ -252,21 +252,12 @@ static void *queue_thread_main (void *args __attribute__((unused))) /* {{{ */
      * something comes in or it's time to do the cache flush. */
     if (cache_queue_head == NULL)
     {
-      struct timespec timeout;
-
-      timeout.tv_sec = next_flush.tv_sec - now.tv_sec;
-      if (next_flush.tv_nsec < (1000 * now.tv_usec))
-      {
-        timeout.tv_sec--;
-        timeout.tv_nsec = 1000000000 + next_flush.tv_nsec
-          - (1000 * now.tv_usec);
-      }
-      else
+      status = pthread_cond_timedwait (&cache_cond, &cache_lock, &next_flush);
+      if ((status != 0) && (status != ETIMEDOUT))
       {
-        timeout.tv_nsec = next_flush.tv_nsec - (1000 * now.tv_usec);
+        RRDD_LOG (LOG_ERR, "queue_thread_main: "
+            "pthread_cond_timedwait returned %i.", status);
       }
-
-      pthread_cond_timedwait (&cache_cond, &cache_lock, &timeout);
     }
 
     /* Check if a value has arrived. This may be NULL if we timed out or there
@@ -325,7 +316,7 @@ static void *queue_thread_main (void *args __attribute__((unused))) /* {{{ */
 } /* }}} void *queue_thread_main */
 
 static int handle_request_update (int fd, /* {{{ */
-    char *buffer, int buffer_size)
+    char *buffer, int buffer_size __attribute__((unused)))
 {
   char *file;
   char *value;
@@ -340,9 +331,6 @@ static int handle_request_update (int fd, /* {{{ */
 
   now = time (NULL);
 
-  RRDD_LOG (LOG_DEBUG, "handle_request_update (%i, %p, %i)",
-      fd, (void *) buffer, buffer_size);
-
   buffer_ptr = buffer;
 
   file = buffer_ptr;
@@ -438,8 +426,6 @@ static int handle_request (int fd) /* {{{ */
   char buffer[4096];
   int buffer_size;
 
-  RRDD_LOG (LOG_DEBUG, "handle_request (%i)", fd);
-
   buffer_size = read (fd, buffer, sizeof (buffer));
   if (buffer_size < 1)
   {
@@ -478,8 +464,6 @@ static void *connection_thread_main (void *args /* {{{ */
   
   fd = *((int *) args);
 
-  RRDD_LOG (LOG_DEBUG, "connection_thread_main: Adding myself to "
-      "connetion_threads[]..");
   pthread_mutex_lock (&connetion_threads_lock);
   {
     pthread_t *temp;
@@ -498,7 +482,6 @@ static void *connection_thread_main (void *args /* {{{ */
     }
   }
   pthread_mutex_unlock (&connetion_threads_lock);
-  RRDD_LOG (LOG_DEBUG, "connection_thread_main: done");
 
   while (do_shutdown == 0)
   {
@@ -523,8 +506,6 @@ static void *connection_thread_main (void *args /* {{{ */
 
     if ((pollfd.revents & POLLHUP) != 0) /* normal shutdown */
     {
-      RRDD_LOG (LOG_DEBUG, "connection_thread_main: "
-          "poll(2) returned POLLHUP.");
       close (fd);
       break;
     }
@@ -808,9 +789,6 @@ static void *listen_thread_main (void *args __attribute__((unused))) /* {{{ */
         continue;
       }
 
-      RRDD_LOG (LOG_DEBUG, "listen_thread_main: accept(2) returned fd #%i.",
-          *client_sd);
-
       status = pthread_create (&tid, /* attr = */ NULL, connection_thread_main,
           /* args = */ (void *) client_sd);
       if (status != 0)
@@ -820,10 +798,6 @@ static void *listen_thread_main (void *args __attribute__((unused))) /* {{{ */
         free (client_sd);
         continue;
       }
-
-      RRDD_LOG (LOG_DEBUG, "listen_thread_main: pthread_create succeeded: "
-          "tid = %lu",
-          *((unsigned long *) &tid));
     } /* for (pollfds_num) */
   } /* while (do_shutdown == 0) */