[rrd-developers] [PATCH] Make sure that cache_item_t.flushed is properly initialized.

kevin brintnall kbrint at rufus.net
Wed Oct 22 02:18:51 CEST 2008


The previous code relied on the assumption that pthread_cond_init(&cond)
was equivalent to memset(&cond,0).  This may not be true on all platforms.
---
 src/rrd_daemon.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/rrd_daemon.c b/src/rrd_daemon.c
index d404e04..38b2eba 100644
--- a/src/rrd_daemon.c
+++ b/src/rrd_daemon.c
@@ -1450,6 +1450,7 @@ static int handle_request_update (listen_socket_t *sock, /* {{{ */
 
     wipe_ci_values(ci, now);
     ci->flags = CI_FLAGS_IN_TREE;
+    ci->flushed = PTHREAD_COND_INITIALIZER;
 
     pthread_mutex_lock(&cache_lock);
     g_tree_insert (cache_tree, (void *) ci->file, (void *) ci);
-- 
1.6.0.2



More information about the rrd-developers mailing list