1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-06 08:26:52 +03:00

ratelimit: if interval/burst are set to 0, assume ratelimiting shall be disabled

This commit is contained in:
Lennart Poettering 2012-02-08 21:35:49 +01:00
parent e8ab3ccba4
commit cafac610a7

View File

@ -30,11 +30,12 @@
bool ratelimit_test(RateLimit *r) {
usec_t ts;
ts = now(CLOCK_MONOTONIC);
assert(r);
assert(r->interval > 0);
assert(r->burst > 0);
if (r->interval <= 0 || r->burst <= 0)
return true;
ts = now(CLOCK_MONOTONIC);
if (r->begin <= 0 ||
r->begin + r->interval < ts) {