auto import from //branches/cupcake/...@132276
diff --git a/libc/bionic/pthread-timers.c b/libc/bionic/pthread-timers.c
index b8f7488..818b47d 100644
--- a/libc/bionic/pthread-timers.c
+++ b/libc/bionic/pthread-timers.c
@@ -469,7 +469,7 @@
     }
 
     if ( __likely(!TIMER_ID_IS_WRAPPED(id)) ) {
-        return __timer_gettime( id, ospec );
+        return __timer_settime( id, flags, spec, ospec );
     } else {
         thr_timer_t*        timer = thr_timer_from_id(id);
         struct timespec     expires, now;
@@ -560,11 +560,11 @@
         if (timespec_cmp( &expires, &now ) > 0)
         {
             /* cool, there was no overrun, so compute the
-             * relative timeout as 'now - expires', then wait
+             * relative timeout as 'expires - now', then wait
              */
             int              ret;
-            struct timespec  diff = now;
-            timespec_sub( &diff, &expires );
+            struct timespec  diff = expires;
+            timespec_sub( &diff, &now );
 
             ret = __pthread_cond_timedwait_relative(
                         &timer->cond, &timer->mutex, &diff);