chiark / gitweb /
exec: introduce PrivateNetwork= process option to turn off network access to specific...
[elogind.git] / src / ratelimit.c
index fc0f71de8bf2ebb4e562b496105a77629321ad7e..1ddc83187f59295fc2402a63a75fa637fbf88210 100644 (file)
@@ -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.
@@ -38,25 +38,19 @@ bool ratelimit_test(RateLimit *r) {
 
         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;
 
-                /* Reset counters */
-                r->n_printed = 0;
-                r->n_missed = 0;
+                /* Reset counter */
+                r->num = 0;
                 goto good;
         }
 
-        if (r->n_printed <= r->burst)
+        if (r->num <= r->burst)
                 goto good;
 
-        r->n_missed++;
         return false;
 
 good:
-        r->n_printed++;
+        r->num++;
         return true;
 }