]> sourceware.org Git - newlib-cygwin.git/commitdiff
Cygwin: timerfd: settime: fix computing DueTime on non-realtime clocks
authorCorinna Vinschen <corinna@vinschen.de>
Mon, 21 Jan 2019 09:05:13 +0000 (10:05 +0100)
committerCorinna Vinschen <corinna@vinschen.de>
Mon, 21 Jan 2019 09:05:16 +0000 (10:05 +0100)
Non-CLOCK_REALTIME counters always use a relative DueTime in NtSetTimer.
However, relative DueTime has to be negative, but the code

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
winsup/cygwin/timerfd.cc

index e5c17fb4e595256695a9c358e724b331610bf36e..64836b021fb6ba912f8ecaecb6be77b166becbf0 100644 (file)
@@ -532,7 +532,7 @@ timerfd_shared::arm_timer (int flags, const struct itimerspec *new_value)
        DueTime.QuadPart = ts + FACTOR;
       else /* non-REALTIME clocks require relative DueTime. */
        {
-         DueTime.QuadPart = ts - get_clock_now ();
+         DueTime.QuadPart = get_clock_now () - ts;
          /* If the timestamp was earlier than now, compute number
             of overruns and offset DueTime to expire immediately. */
          if (DueTime.QuadPart >= 0)
This page took 0.038973 seconds and 5 git commands to generate.