chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
exec: introduce PrivateNetwork= process option to turn off network access to specific...
[elogind.git]
/
src
/
ratelimit.c
diff --git
a/src/ratelimit.c
b/src/ratelimit.c
index fc0f71de8bf2ebb4e562b496105a77629321ad7e..1ddc83187f59295fc2402a63a75fa637fbf88210 100644
(file)
--- a/
src/ratelimit.c
+++ b/
src/ratelimit.c
@@
-1,4
+1,4
@@
-/*-*- Mode: C; c-basic-offset: 8 -*-*/
+/*-*- Mode: C; c-basic-offset: 8
; indent-tabs-mode: nil
-*-*/
/***
This file is part of systemd.
/***
This file is part of systemd.
@@
-38,25
+38,19
@@
bool ratelimit_test(RateLimit *r) {
if (r->begin <= 0 ||
r->begin + r->interval < ts) {
if (r->begin <= 0 ||
r->begin + r->interval < ts) {
-
- if (r->n_missed > 0)
- log_warning("%u events suppressed", r->n_missed);
-
r->begin = ts;
r->begin = ts;
- /* Reset counters */
- r->n_printed = 0;
- r->n_missed = 0;
+ /* Reset counter */
+ r->num = 0;
goto good;
}
goto good;
}
- if (r->n
_printed
<= r->burst)
+ if (r->n
um
<= r->burst)
goto good;
goto good;
- r->n_missed++;
return false;
good:
return false;
good:
- r->n
_printed
++;
+ r->n
um
++;
return true;
}
return true;
}