X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fdaemon%2Futils_threshold.c;h=784e109484a2725d82b3660b8abc996fa7ffe856;hb=5523a080010dcb7a61dc0dccc3969a2a048e52f9;hp=4a8df89d69e70c147e1fa8820c7884d1931b427c;hpb=ca4a6c8a856a9012270ec10389b08d54e70e3401;p=collectd.git diff --git a/src/daemon/utils_threshold.c b/src/daemon/utils_threshold.c index 4a8df89d..784e1094 100644 --- a/src/daemon/utils_threshold.c +++ b/src/daemon/utils_threshold.c @@ -25,6 +25,7 @@ **/ #include "collectd.h" + #include "common.h" #include "utils_avltree.h" #include "utils_threshold.h" @@ -124,16 +125,16 @@ int ut_search_threshold (const value_list_t *vl, /* {{{ */ if (vl == NULL) return (EINVAL); - /* Is this lock really necessary? */ - pthread_mutex_lock (&threshold_lock); + /* Is this lock really necessary? */ + pthread_mutex_lock (&threshold_lock); t = threshold_search (vl); if (t == NULL) { - pthread_mutex_unlock (&threshold_lock); + pthread_mutex_unlock (&threshold_lock); return (ENOENT); - } + } memcpy (ret_threshold, t, sizeof (*ret_threshold)); - pthread_mutex_unlock (&threshold_lock); + pthread_mutex_unlock (&threshold_lock); ret_threshold->next = NULL;