richardphibel / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
21255d
From 1aae57f763cacbdeb10647c627cf307f79ad00ca Mon Sep 17 00:00:00 2001
21255d
From: Vito Caputo <vcaputo@pengaru.com>
21255d
Date: Tue, 1 Dec 2020 00:26:54 -0800
21255d
Subject: [PATCH] sd-event: fix delays assert brain-o (#17790)
21255d
21255d
s/sizeof/ELEMENTSOF/
21255d
21255d
Bug introduced in 34b87517749caa4142b19eb3c63bdf349fafbc49.
21255d
21255d
(cherry picked from commit cb9d621ebbfa30bbd620c17e143daeb0d78c12f0)
21255d
21255d
Related: #1819868
21255d
---
21255d
 src/libsystemd/sd-event/sd-event.c | 2 +-
21255d
 1 file changed, 1 insertion(+), 1 deletion(-)
21255d
21255d
diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c
21255d
index de9bb02059..9d42157206 100644
21255d
--- a/src/libsystemd/sd-event/sd-event.c
21255d
+++ b/src/libsystemd/sd-event/sd-event.c
21255d
@@ -3586,7 +3586,7 @@ _public_ int sd_event_run(sd_event *e, uint64_t timeout) {
21255d
                 this_run = now(CLOCK_MONOTONIC);
21255d
 
21255d
                 l = u64log2(this_run - e->last_run);
21255d
-                assert(l < sizeof(e->delays));
21255d
+                assert(l < ELEMENTSOF(e->delays));
21255d
                 e->delays[l]++;
21255d
 
21255d
                 if (this_run - e->last_log >= 5*USEC_PER_SEC) {