diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-05-11 11:16:52 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-05-13 22:08:30 +0200 |
commit | 7994ac1d851b39ee87181fbdbfe413f83f65260a (patch) | |
tree | 2ff5d4c638a5e42d624afff22b81ead090e76237 /src/timesync | |
parent | 22dd8d350c635fb2ccd4641d19cf43f73cae4f6d (diff) | |
download | systemd-7994ac1d851b39ee87181fbdbfe413f83f65260a.tar.gz |
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.
Diffstat (limited to 'src/timesync')
-rw-r--r-- | src/timesync/timesyncd-manager.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/timesync/timesyncd-manager.c b/src/timesync/timesyncd-manager.c index 4f639577ad..f76f07e655 100644 --- a/src/timesync/timesyncd-manager.c +++ b/src/timesync/timesyncd-manager.c @@ -804,7 +804,7 @@ int manager_connect(Manager *m) { manager_disconnect(m); m->event_retry = sd_event_source_unref(m->event_retry); - if (!ratelimit_test(&m->ratelimit)) { + if (!ratelimit_below(&m->ratelimit)) { log_debug("Slowing down attempts to contact servers."); r = sd_event_add_time(m->event, &m->event_retry, clock_boottime_or_monotonic(), now(clock_boottime_or_monotonic()) + RETRY_USEC, 0, manager_retry_connect, m); |