446ea3
From b8732d647162b50ce9b34de2ad7ae11a53f6e7ba Mon Sep 17 00:00:00 2001
446ea3
From: Yu Watanabe <watanabe.yu+github@gmail.com>
446ea3
Date: Tue, 15 Jun 2021 01:01:48 +0900
446ea3
Subject: [PATCH] sd-event: use usec_add()
446ea3
446ea3
(cherry picked from commit a595fb5ca9c69c589e758e9ebe3b70ac90450ba3)
446ea3
446ea3
Related: #1984406
446ea3
---
446ea3
 src/libsystemd/sd-event/sd-event.c | 4 ++--
446ea3
 1 file changed, 2 insertions(+), 2 deletions(-)
446ea3
446ea3
diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c
446ea3
index 6a20b658e4..f675c09d84 100644
446ea3
--- a/src/libsystemd/sd-event/sd-event.c
446ea3
+++ b/src/libsystemd/sd-event/sd-event.c
446ea3
@@ -3514,8 +3514,8 @@ static int arm_watchdog(sd_event *e) {
446ea3
         assert(e->watchdog_fd >= 0);
446ea3
 
446ea3
         t = sleep_between(e,
446ea3
-                          e->watchdog_last + (e->watchdog_period / 2),
446ea3
-                          e->watchdog_last + (e->watchdog_period * 3 / 4));
446ea3
+                          usec_add(e->watchdog_last, (e->watchdog_period / 2)),
446ea3
+                          usec_add(e->watchdog_last, (e->watchdog_period * 3 / 4)));
446ea3
 
446ea3
         timespec_store(&its.it_value, t);
446ea3