ryantimwilson / rpms / systemd

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