X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fratelimit.c;h=fc0f71de8bf2ebb4e562b496105a77629321ad7e;hp=1e5ed03c55dbde295d096ba679cdacaae588db07;hb=8f75a603ec833a07a9d9d05782713807297c0c53;hpb=e99e38bbdcca3fe5956823bdb3d38544ccf93221 diff --git a/src/ratelimit.c b/src/ratelimit.c index 1e5ed03c5..fc0f71de8 100644 --- a/src/ratelimit.c +++ b/src/ratelimit.c @@ -28,21 +28,21 @@ * , which is licensed GPLv2. */ bool ratelimit_test(RateLimit *r) { - usec_t timestamp; + usec_t ts; - timestamp = now(CLOCK_MONOTONIC); + ts = now(CLOCK_MONOTONIC); assert(r); assert(r->interval > 0); assert(r->burst > 0); if (r->begin <= 0 || - r->begin + r->interval < timestamp) { + r->begin + r->interval < ts) { if (r->n_missed > 0) log_warning("%u events suppressed", r->n_missed); - r->begin = timestamp; + r->begin = ts; /* Reset counters */ r->n_printed = 0;