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
path: root/winsup
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2010-05-26 18:48:17 +0400
committerChristopher Faylor <me@cgf.cx>2010-05-26 18:48:17 +0400
commitfca8f35f1133a9442f3301aef613e7d79ee3a343 (patch)
tree5b8745b5dbd1e2e71a405c814a4e9d7dc21a8e7e /winsup
parent1ee8d76ca047d18c6462d70850fc64de35c631f5 (diff)
* hires.h (hires_base::reset): New function.
(hires_us): Specify that hires_base is a public import. (hires_ms): Ditto. * times.cc (gtod): Move earlier in file. (settimeofday): Reset gtod so that base will be subsequently recalculated.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog9
-rw-r--r--winsup/cygwin/hires.h8
-rw-r--r--winsup/cygwin/times.cc5
3 files changed, 17 insertions, 5 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 14f8e9662..c327d92fd 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,12 @@
+2010-05-26 Christopher Faylor <me+cygwin@cgf.cx>
+
+ * hires.h (hires_base::reset): New function.
+ (hires_us): Specify that hires_base is a public import.
+ (hires_ms): Ditto.
+ * times.cc (gtod): Move earlier in file.
+ (settimeofday): Reset gtod so that base will be subsequently
+ recalculated.
+
2010-05-26 Corinna Vinschen <corinna@vinschen.de>
* path.cc (symlink_info::check): Don't try to handle remote reparse
diff --git a/winsup/cygwin/hires.h b/winsup/cygwin/hires.h
index e91df0690..6a7fe8c72 100644
--- a/winsup/cygwin/hires.h
+++ b/winsup/cygwin/hires.h
@@ -1,6 +1,6 @@
/* hires.h: Definitions for hires clock calculations
- Copyright 2002, 2003, 2004, 2005, 2009 Red Hat, Inc.
+ Copyright 2002, 2003, 2004, 2005, 2009, 2010 Red Hat, Inc.
This file is part of Cygwin.
@@ -25,9 +25,11 @@ class hires_base
{
protected:
int inited;
+ public:
+ void reset() {inited = false;}
};
-class hires_us : hires_base
+class hires_us : public hires_base
{
LARGE_INTEGER primed_ft;
LARGE_INTEGER primed_pc;
@@ -37,7 +39,7 @@ class hires_us : hires_base
LONGLONG usecs (bool justdelta);
};
-class hires_ms : hires_base
+class hires_ms : public hires_base
{
LONGLONG initime_ns;
void prime ();
diff --git a/winsup/cygwin/times.cc b/winsup/cygwin/times.cc
index 39fc6546a..f6f23bbbb 100644
--- a/winsup/cygwin/times.cc
+++ b/winsup/cygwin/times.cc
@@ -28,6 +28,8 @@ details. */
#define FACTOR (0x19db1ded53e8000LL)
#define NSPERSEC 10000000LL
+hires_ms NO_COPY gtod;
+
static inline LONGLONG
systime_ns ()
{
@@ -116,6 +118,7 @@ settimeofday (const struct timeval *tv, const struct timezone *tz)
st.wMilliseconds = tv->tv_usec / 1000;
res = !SetSystemTime (&st);
+ gtod.reset ();
syscall_printf ("%d = settimeofday (%x, %x)", res, tv, tz);
@@ -146,8 +149,6 @@ totimeval (struct timeval *dst, FILETIME *src, int sub, int flag)
dst->tv_sec = x / (long long) (1e6);
}
-hires_ms NO_COPY gtod;
-
/* FIXME: Make thread safe */
extern "C" int
gettimeofday (struct timeval *tv, void *tzvp)