summaryrefslogtreecommitdiffstats
path: root/winsup
diff options
context:
space:
mode:
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog4
-rw-r--r--winsup/cygwin/times.cc6
2 files changed, 10 insertions, 0 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 39af363f7..93858441a 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,7 @@
+2004-06-30 Corinna Vinschen <corinna@vinschen.de>
+
+ * times.cc (hires_ms::usecs): Reinit timer when system time overflows.
+
2004-06-27 Christopher Faylor <me@cgf.cx>
* thread.cc (__cygwin_lock_lock): Don't bother locking when there is
diff --git a/winsup/cygwin/times.cc b/winsup/cygwin/times.cc
index 635d05a37..0674122b1 100644
--- a/winsup/cygwin/times.cc
+++ b/winsup/cygwin/times.cc
@@ -658,6 +658,12 @@ hires_ms::usecs (bool justdelta)
if (!minperiod) /* NO_COPY variable */
prime ();
DWORD now = timeGetTime ();
+ if (now <= initime_ms)
+ {
+ inited = 0;
+ prime ();
+ now = timeGetTime ();
+ }
// FIXME: Not sure how this will handle the 49.71 day wrap around
LONGLONG res = initime_us.QuadPart + ((LONGLONG) (now - initime_ms) * 1000);
return res;