summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2020-12-01 00:26:54 -0800
committerThe Plumber <50238977+systemd-rhel-bot@users.noreply.github.com>2021-03-10 12:41:30 +0100
commit1aae57f763cacbdeb10647c627cf307f79ad00ca (patch)
treebbbdbe5f1e87d0cee276b1cec8d283b1c1deafe8
parent88b2618e4de850060a1c5c22b049e6de0578fbb5 (diff)
downloadsystemd-1aae57f763cacbdeb10647c627cf307f79ad00ca.tar.gz
sd-event: fix delays assert brain-o (#17790)
s/sizeof/ELEMENTSOF/ Bug introduced in 34b87517749caa4142b19eb3c63bdf349fafbc49. (cherry picked from commit cb9d621ebbfa30bbd620c17e143daeb0d78c12f0) Related: #1819868
-rw-r--r--src/libsystemd/sd-event/sd-event.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c
index de9bb02059..9d42157206 100644
--- a/src/libsystemd/sd-event/sd-event.c
+++ b/src/libsystemd/sd-event/sd-event.c
@@ -3586,7 +3586,7 @@ _public_ int sd_event_run(sd_event *e, uint64_t timeout) {
this_run = now(CLOCK_MONOTONIC);
l = u64log2(this_run - e->last_run);
- assert(l < sizeof(e->delays));
+ assert(l < ELEMENTSOF(e->delays));
e->delays[l]++;
if (this_run - e->last_log >= 5*USEC_PER_SEC) {