Cygwin: timerfd: settime: fix computing DueTime on non-realtime clocks

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>
This commit is contained in:
Corinna Vinschen 2019-01-21 10:05:13 +01:00
parent a3268ac392
commit 6ed50a68a1
1 changed files with 1 additions and 1 deletions

View 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)