Rename ratelimit_test to ratelimit_below
When I see "test", I have to think three times what the return value
means. With "below" this is immediately clear. ratelimit_below(&limit)
sounds almost like English and is imho immediately obvious.
(I also considered ratelimit_ok, but this strongly implies that being under the
limit is somehow better. Most of the times this is true, but then we use the
ratelimit to detect triple-c-a-d, and "ok" doesn't fit so well there.)
C.f. a1bcaa07.
This commit is contained in:
+1
-1
@@ -845,7 +845,7 @@ static int device_dispatch_io(sd_event_source *source, int fd, uint32_t revents,
|
||||
if (revents != EPOLLIN) {
|
||||
static RATELIMIT_DEFINE(limit, 10*USEC_PER_SEC, 5);
|
||||
|
||||
if (ratelimit_test(&limit))
|
||||
if (ratelimit_below(&limit))
|
||||
log_warning("Failed to get udev event");
|
||||
if (!(revents & EPOLLIN))
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user