summaryrefslogtreecommitdiff
path: root/src/journal/journald-rate-limit.c
diff options
context:
space:
mode:
authorYuki Inoguchi <inoguchi.yuki@jp.fujitsu.com>2016-10-06 18:44:51 +0900
committerLennart Poettering <lennart@poettering.net>2016-10-06 11:44:51 +0200
commitd2665e0866772663ad7c774c05bf2e0dc8ddcb04 (patch)
tree5421321e3c65b819d8d64c7995aba245bbd39410 /src/journal/journald-rate-limit.c
parent100a5f579db3fd9aa4418225f0928b99ecee3807 (diff)
downloadsystemd-d2665e0866772663ad7c774c05bf2e0dc8ddcb04.tar.gz
journald, ratelimit: fix inaccurate message suppression in journal_rate_limit_test() (#4291)
Currently, the ratelimit does not handle the number of suppressed messages accurately. Even though the number of messages reaches the limit, it still allows to add one extra messages to journal. This patch fixes the problem.
Diffstat (limited to 'src/journal/journald-rate-limit.c')
-rw-r--r--src/journal/journald-rate-limit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/journal/journald-rate-limit.c b/src/journal/journald-rate-limit.c
index d30bf92cec..f48639cf58 100644
--- a/src/journal/journald-rate-limit.c
+++ b/src/journal/journald-rate-limit.c
@@ -261,7 +261,7 @@ int journal_rate_limit_test(JournalRateLimit *r, const char *id, int priority, u
return 1 + s;
}
- if (p->num <= burst) {
+ if (p->num < burst) {
p->num++;
return 1;
}