From 04a76831e7987e4e1f25f7d8639e527cc8e56b48 Mon Sep 17 00:00:00 2001
From: Yu Watanabe <watanabe.yu+github@gmail.com>
Date: Tue, 15 Jun 2021 01:01:48 +0900
Subject: [PATCH] sd-event: use usec_add()

(cherry picked from commit a595fb5ca9c69c589e758e9ebe3b70ac90450ba3)

Conflict:NA
Reference:https://github.com/systemd/systemd-stable/commit/04a76831e7987e4e1f25f7d8639e527cc8e56b48
---
 src/libsystemd/sd-event/sd-event.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c
index 909266b84d..d2b50e9347 100644
--- a/src/libsystemd/sd-event/sd-event.c
+++ b/src/libsystemd/sd-event/sd-event.c
@@ -3694,8 +3694,8 @@ static int arm_watchdog(sd_event *e) {
         assert(e->watchdog_fd >= 0);
 
         t = sleep_between(e,
-                          e->watchdog_last + (e->watchdog_period / 2),
-                          e->watchdog_last + (e->watchdog_period * 3 / 4));
+                          usec_add(e->watchdog_last, (e->watchdog_period / 2)),
+                          usec_add(e->watchdog_last, (e->watchdog_period * 3 / 4)));
 
         timespec_store(&its.it_value, t);
 
-- 
2.27.0

