diff options
author | Eric Faurot <eric@cvs.openbsd.org> | 2014-07-08 10:22:16 +0000 |
---|---|---|
committer | Eric Faurot <eric@cvs.openbsd.org> | 2014-07-08 10:22:16 +0000 |
commit | ff4dfd48cd5efab31275b317d26233bb1f5663aa (patch) | |
tree | 429569e891136b90b19d0898a358138e510d3e8e /usr.sbin | |
parent | 99610462ec72b8eeb1d99ef7a6ff8558c21ae642 (diff) |
no need to send a stat update message when {inc,dec}rementing by 0.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/smtpd/stat_backend.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.sbin/smtpd/stat_backend.c b/usr.sbin/smtpd/stat_backend.c index d145b10c33e..33d1fa573ae 100644 --- a/usr.sbin/smtpd/stat_backend.c +++ b/usr.sbin/smtpd/stat_backend.c @@ -1,4 +1,4 @@ -/* $OpenBSD: stat_backend.c,v 1.8 2013/05/24 17:03:14 eric Exp $ */ +/* $OpenBSD: stat_backend.c,v 1.9 2014/07/08 10:22:15 eric Exp $ */ /* * Copyright (c) 2012 Gilles Chehade <gilles@poolp.org> @@ -49,6 +49,9 @@ stat_increment(const char *key, size_t count) { struct stat_value *value; + if (count == 0) + return; + value = stat_counter(count); m_create(p_control, IMSG_STAT_INCREMENT, 0, 0, -1); @@ -62,6 +65,9 @@ stat_decrement(const char *key, size_t count) { struct stat_value *value; + if (count == 0) + return; + value = stat_counter(count); m_create(p_control, IMSG_STAT_DECREMENT, 0, 0, -1); |