From: Thomas Gleixner Date: Wed, 1 Feb 2006 11:05:13 +0000 (-0800) Subject: [PATCH] hrtimers: set correct initial expiry time for relative SIGEV_NONE timers X-Git-Tag: v2.6.16-rc2~128 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=952bbc87f01f552ef091a62ea2a721b5b2670e74;p=linux-2.6 [PATCH] hrtimers: set correct initial expiry time for relative SIGEV_NONE timers The expiry time for relative timers with SIGEV_NONE set was never updated to the correct value. Pointed out by George Anzinger. Signed-off-by: Thomas Gleixner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c index 28e72fd002..aad6f138d5 100644 --- a/kernel/posix-timers.c +++ b/kernel/posix-timers.c @@ -724,8 +724,13 @@ common_timer_set(struct k_itimer *timr, int flags, timr->it.real.interval = timespec_to_ktime(new_setting->it_interval); /* SIGEV_NONE timers are not queued ! See common_timer_get */ - if (((timr->it_sigev_notify & ~SIGEV_THREAD_ID) == SIGEV_NONE)) + if (((timr->it_sigev_notify & ~SIGEV_THREAD_ID) == SIGEV_NONE)) { + /* Setup correct expiry time for relative timers */ + if (mode == HRTIMER_REL) + timer->expires = ktime_add(timer->expires, + timer->base->get_time()); return 0; + } hrtimer_start(timer, timer->expires, mode); return 0;