]> arthur.barton.de Git - netdata.git/blobdiff - src/rrd.c
health configuration now parses templates too
[netdata.git] / src / rrd.c
index b24da252b98376e3b6b8d929f1cc7f70083ebf76..6afd93c34215add1b975274a12811abe9d3a3a6b 100644 (file)
--- a/src/rrd.c
+++ b/src/rrd.c
@@ -56,9 +56,10 @@ void rrdhost_unlock(RRDHOST *host) {
 }
 
 void rrdhost_check_wrlock_int(RRDHOST *host, const char *file, const char *function, const unsigned long line) {
-    if(pthread_rwlock_tryrdlock(&host->rrdset_root_rwlock) == 0) {
+    int ret = pthread_rwlock_tryrdlock(&host->rrdset_root_rwlock);
+
+    if(ret != 0)
         fatal("RRDHOST '%s' should be write-locked, but it is not, at function %s() at line %lu of file '%s'", host->hostname, function, line, file);
-    }
 }
 
 // ----------------------------------------------------------------------------