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>2004-06-30 19:50:08 +0400
committerCorinna Vinschen <corinna@vinschen.de>2004-06-30 19:50:08 +0400
commitfbd5a0b8da7b1d75aab621a10cfea250a62a49fd (patch)
treeed4a6532dc9650e8079228544b317b18eaa4095b /winsup/cygwin/times.cc
parent81223d017f09f34680f80df398d19165ab372525 (diff)
* times.cc (hires_ms::usecs): Reinit timer when system time overflows.
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;