X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Femail.c;h=bbee9bb699f041a9b4d26bb9019dc0746a85479c;hb=528a9dfd368b95c4f741827fe4e953124eb17270;hp=64b82e465c1af5ea9df81f0eb59fbfdf50f7478e;hpb=d243ecd0cd17fa1a4a9ee3fca6f417acc5ee3117;p=collectd.git diff --git a/src/email.c b/src/email.c index 64b82e46..bbee9bb6 100644 --- a/src/email.c +++ b/src/email.c @@ -486,9 +486,11 @@ static void *collect (void *arg) type_list_incr (&count, type, 1); pthread_mutex_unlock (&count_mutex); - pthread_mutex_lock (&size_mutex); - type_list_incr (&size, type, bytes); - pthread_mutex_unlock (&size_mutex); + if (bytes > 0) { + pthread_mutex_lock (&size_mutex); + type_list_incr (&size, type, bytes); + pthread_mutex_unlock (&size_mutex); + } } else if ('s' == line[0]) { /* s: */ pthread_mutex_lock (&score_mutex); @@ -773,7 +775,7 @@ static void score_submit (double value) if ((len < 0) || (len >= BUFSIZE)) return; - plugin_submit ("email_spam_score", NULL, buf); + plugin_submit ("email_spam_score", "-", buf); return; } /* static void score_submit (double) */