summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/times.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/times.cc')
-rw-r--r--winsup/cygwin/times.cc6
1 files changed, 6 insertions, 0 deletions
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;