summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-11-12 12:33:10 +0100
committerLennart Poettering <lennart@poettering.net>2015-11-12 12:33:10 +0100
commit4de2402b603ea2f518f451d06f09e15aeae54fab (patch)
treede2a2996ac94633ee52b00a647bab0cbc223f3ef /src
parent33d52ab92f2f0bfd706e6f343d172618d1e03f3d (diff)
journald: fix accuracy of watchdog timer event
Adding 3/4th of the watchdog frequency as accuracy on top of 1/2 of the watchdog frequency means we might end up at 5/4th of the frequency which means we might miss the message from time to time. Maybe fixes #1804
Diffstat (limited to 'src')
-rw-r--r--src/journal/journald-server.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index 762b810109..be913d26ef 100644
--- a/src/journal/journald-server.c
+++ b/src/journal/journald-server.c
@@ -1670,7 +1670,7 @@ static int server_connect_notify(Server *s) {
if (sd_watchdog_enabled(false, &s->watchdog_usec) > 0) {
s->send_watchdog = true;
- r = sd_event_add_time(s->event, &s->watchdog_event_source, CLOCK_MONOTONIC, now(CLOCK_MONOTONIC) + s->watchdog_usec/2, s->watchdog_usec*3/4, dispatch_watchdog, s);
+ r = sd_event_add_time(s->event, &s->watchdog_event_source, CLOCK_MONOTONIC, now(CLOCK_MONOTONIC) + s->watchdog_usec/2, s->watchdog_usec/4, dispatch_watchdog, s);
if (r < 0)
return log_error_errno(r, "Failed to add watchdog time event: %m");
}