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:
parent
a3268ac392
commit
6ed50a68a1
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user