From fbd5a0b8da7b1d75aab621a10cfea250a62a49fd Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 30 Jun 2004 15:50:08 +0000 Subject: * times.cc (hires_ms::usecs): Reinit timer when system time overflows. --- winsup/cygwin/times.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'winsup/cygwin/times.cc') 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; -- cgit v1.2.3