Code

This patch removes an extra "SIGNALS" section in the rrdcached.pod and
[rrdtool.git] / src / rrd_daemon.c
index e2330a8dc05c0c2d68c0746e1946652745cc224a..f92de21210af6c829243395e4fb776b9caf7d01a 100644 (file)
@@ -814,10 +814,13 @@ static int flush_file (const char *filename) /* {{{ */
     return (ENOENT);
   }
 
-  /* Enqueue at head */
-  enqueue_cache_item (ci, HEAD);
+  if (ci->values_num > 0)
+  {
+    /* Enqueue at head */
+    enqueue_cache_item (ci, HEAD);
+    pthread_cond_wait(&ci->flushed, &cache_lock);
+  }
 
-  pthread_cond_wait(&ci->flushed, &cache_lock);
   pthread_mutex_unlock(&cache_lock);
 
   return (0);