Hi Tobi,

On Sun, Nov 02, 2008 at 04:36:31PM +0100, Tobias Oetiker wrote:
> The problem ist that you are setting
> 
> static pthread_cond_t  cache_cond = PTHREAD_COND_INITIALIZER;

This is fine. PTHREAD_COND_INITIALIZER may be used to initialize
_static_ condition variables ...

> rrd_daemon.c: In function 'handle_request_update':
> rrd_daemon.c:1453: error: expected expression before '{' token

... which is not the case in handle_request_update() though.

> fix ?

See the attached patch.

HTH,
Sebastian

-- 
Sebastian "tokkee" Harl +++ GnuPG-ID: 0x8501C7FC +++ http://tokkee.org/

Those who would give up Essential Liberty to purchase a little Temporary
Safety, deserve neither Liberty nor Safety.         -- Benjamin Franklin

From 36f5b9d7907eaf52b4bebbc161d4869676d93ffc Mon Sep 17 00:00:00 2001
From: Sebastian Harl <[EMAIL PROTECTED]>
Date: Sun, 2 Nov 2008 17:08:17 +0100
Subject: [PATCH] rrd_daemon: Use pthread_cond_init() to initialize non-static cond variables.

PTHREAD_COND_INITIALIZER may only be used to initialize static cond variables.
---
 program/src/rrd_daemon.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/program/src/rrd_daemon.c b/program/src/rrd_daemon.c
index bee21a2..7201c52 100644
--- a/program/src/rrd_daemon.c
+++ b/program/src/rrd_daemon.c
@@ -1450,7 +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_cond_init(&ci->flushed, NULL);
 
     pthread_mutex_lock(&cache_lock);
     g_tree_insert (cache_tree, (void *) ci->file, (void *) ci);
-- 
1.6.0.3.523.g304d0

Attachment: signature.asc
Description: Digital signature

_______________________________________________
rrd-developers mailing list
[email protected]
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-developers

Reply via email to