This should not make any difference, but, in theory, this is a semantical
error, so, let's just fix it :-)
Thanks to Stefan Völkel for pointing this out.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
static int rrd_flush (const int timeout)
{
- if (cache == NULL)
+ pthread_mutex_lock (&cache_lock);
+
+ if (cache == NULL) {
+ pthread_mutex_unlock (&cache_lock);
return (0);
+ }
- pthread_mutex_lock (&cache_lock);
rrd_cache_flush (timeout);
pthread_mutex_unlock (&cache_lock);
return (0);