X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fdaemon%2Futils_threshold.c;h=cb1ea34a16f25851dd397c30bb07477b6f09ae1d;hb=b599cc64d3ba270fb9fb7116631a01b7404f1a9b;hp=4a8df89d69e70c147e1fa8820c7884d1931b427c;hpb=09c6a320f3cb36b5dbb2c2ce43858f33be7acf9b;p=collectd.git diff --git a/src/daemon/utils_threshold.c b/src/daemon/utils_threshold.c index 4a8df89d..cb1ea34a 100644 --- a/src/daemon/utils_threshold.c +++ b/src/daemon/utils_threshold.c @@ -124,16 +124,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;