daandemeyer / rpms / systemd

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