Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2019-01-21 12:05:13 +0300
committerCorinna Vinschen <corinna@vinschen.de>2019-01-21 12:05:16 +0300
commit6ed50a68a133e7e0c0d10e328bce94f98944dbe5 (patch)
treecbc8c963df3be1135f27281b9bd4ca28754879ec /winsup/cygwin/timerfd.cc
parenta3268ac392241830cf6c91abe663f252c407cf8c (diff)
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>
Diffstat (limited to 'winsup/cygwin/timerfd.cc')
-rw-r--r--winsup/cygwin/timerfd.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/winsup/cygwin/timerfd.cc b/winsup/cygwin/timerfd.cc
index e5c17fb4e..64836b021 100644
--- a/winsup/cygwin/timerfd.cc
+++ b/winsup/cygwin/timerfd.cc
@@ -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)