From dba5fe7696f00628eec4a07b6e80a94885d904e9 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Sun, 7 Feb 2016 03:18:07 +0100 Subject: [PATCH] fixed invalid first timer event --- lib/timing.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/timing.c b/lib/timing.c index 1c5963cc3..2b9904f1b 100644 --- a/lib/timing.c +++ b/lib/timing.c @@ -14,9 +14,12 @@ int timerfd_create_rate(double rate) { int fd, ret; + + struct timespec ts = time_from_double(1 / rate); + struct itimerspec its = { - .it_interval = time_from_double(1 / rate), - .it_value = { 0, 1 } + .it_interval = ts, + .it_value = ts }; fd = timerfd_create(CLOCK_MONOTONIC, 0);