Skip to content

Commit

Permalink
[PATCH] hrtimers: set correct initial expiry time for relative SIGEV_…
Browse files Browse the repository at this point in the history
…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 <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
KAGA-KOKO authored and Linus Torvalds committed Feb 1, 2006
1 parent 66188fa commit 952bbc8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion kernel/posix-timers.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 952bbc8

Please sign in to comment.