From: Florian Forster Date: Thu, 22 Jan 2009 09:08:48 +0000 (+0100) Subject: src/utils_rrdcreate.c: Fix support for non-threadsafe libraries. X-Git-Tag: collectd-4.6.0~96 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e8d081bd185c8dae1233e55741406034b8ba3e2a;p=collectd.git src/utils_rrdcreate.c: Fix support for non-threadsafe libraries. --- diff --git a/src/utils_rrdcreate.c b/src/utils_rrdcreate.c index 8ff025bd..f006d13f 100644 --- a/src/utils_rrdcreate.c +++ b/src/utils_rrdcreate.c @@ -23,6 +23,7 @@ #include "common.h" #include "utils_rrdcreate.h" +#include #include /* @@ -46,6 +47,10 @@ static char *rra_types[] = }; static int rra_types_num = STATIC_ARRAY_SIZE (rra_types); +#if !defined(HAVE_THREADSAFE_LIBRRD) || !HAVE_THREADSAFE_LIBRRD +static pthread_mutex_t librrd_lock = PTHREAD_MUTEX_INITIALIZER; +#endif + /* * Private functions */ @@ -314,7 +319,7 @@ static int srrd_create (const char *filename, /* {{{ */ ssnprintf (last_up_str, sizeof (last_up_str), "%u", (unsigned int) last_up); new_argv[0] = "create"; - new_argv[1] = filename; + new_argv[1] = (void *) filename; new_argv[2] = "-s"; new_argv[3] = pdp_step_str; new_argv[4] = "-b";