aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kernel/posix-timers.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c
index 28e72fd0029..aad6f138d5c 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;