From a799b53f10e5a6fd51fef4436cfb7ec99836a516 Mon Sep 17 00:00:00 2001 From: The Android Open Source Project Date: Tue, 3 Mar 2009 14:03:51 -0800 Subject: auto import from //depot/cupcake/@132589 --- libc/bionic/pthread-timers.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'libc') diff --git a/libc/bionic/pthread-timers.c b/libc/bionic/pthread-timers.c index 7b9c99e..818b47d 100644 --- a/libc/bionic/pthread-timers.c +++ b/libc/bionic/pthread-timers.c @@ -485,19 +485,16 @@ timer_settime( timer_t id, timer_gettime_internal(timer, ospec ); } - /* compute next expiration time. note that if the - * new it_interval is 0, we should disarm the timer - */ + /* compute next expiration time */ expires = spec->it_value; - if (!timespec_is_zero(&expires)) { - clock_gettime( timer->clock, &now ); - if (!(flags & TIMER_ABSTIME)) { - timespec_add(&expires, &now); - } else { - if (timespec_cmp(&expires, &now) < 0) - expires = now; - } + clock_gettime( timer->clock, &now ); + if (!(flags & TIMER_ABSTIME)) { + timespec_add(&expires, &now); + } else { + if (timespec_cmp(&expires, &now) < 0) + expires = now; } + timer->expires = expires; timer->period = spec->it_interval; thr_timer_unlock( timer ); -- cgit v1.1