aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2000-08-30 22:37:24 +0000
committerDJ Delorie <dj@redhat.com>2000-08-30 22:37:24 +0000
commite873a0c7f31ca9135b520a96d851a00120e315d1 (patch)
tree4141838203e18342c74506a5ee19b126c4b3c90c
parent4ba9aab7798ea22fd5b5a9e33bef656a9b5e07e9 (diff)
downloadnewlib-e873a0c7f31ca9135b520a96d851a00120e315d1.zip
newlib-e873a0c7f31ca9135b520a96d851a00120e315d1.tar.gz
newlib-e873a0c7f31ca9135b520a96d851a00120e315d1.tar.bz2
* times.cc (gettimeofday): use GetSystemTimeAsFileTime to avoid a
conversion (FACTOR): correct value (genf): set milliseconds to zero, DOW to 4.
-rw-r--r--winsup/cygwin/ChangeLog7
-rw-r--r--winsup/cygwin/times.cc11
2 files changed, 11 insertions, 7 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 479cbb6..fd1668a 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,10 @@
+2000-08-30 DJ Delorie <dj@redhat.com>
+
+ * times.cc (gettimeofday): use GetSystemTimeAsFileTime to avoid a
+ conversion
+ (FACTOR): correct value
+ (genf): set milliseconds to zero, DOW to 4.
+
2000-08-29 Egor Duda <deo@logos-m.ru>
* grp.cc (getgroups): fail with EINVAL if array is not large
diff --git a/winsup/cygwin/times.cc b/winsup/cygwin/times.cc
index b34d510..8b257ca 100644
--- a/winsup/cygwin/times.cc
+++ b/winsup/cygwin/times.cc
@@ -24,7 +24,7 @@ details. */
#include "sigproc.h"
#include "pinfo.h"
-#define FACTOR (0x19db1ded53ea710LL)
+#define FACTOR (0x19db1ded53e8000LL)
#define NSPERSEC 10000000LL
static void __stdcall timeval_to_filetime (timeval *time, FILETIME *out);
@@ -134,12 +134,9 @@ gettimeofday (struct timeval *p, struct timezone *z)
if (p != NULL)
{
- SYSTEMTIME t;
FILETIME f;
- GetSystemTime (&t);
- if (! SystemTimeToFileTime (&t, &f))
- res = -1;
+ GetSystemTimeAsFileTime (&f);
totimeval (p, &f, 0, 1);
}
@@ -170,12 +167,12 @@ genf ()
FILETIME f;
s.wYear = 1970;
s.wMonth = 1;
- s.wDayOfWeek = 5;
+ s.wDayOfWeek = 4;
s.wDay = 1;
s.wHour = 0;
s.wMinute = 0;
s.wSecond = 0;
- s.wMilliseconds = 1;
+ s.wMilliseconds = 0;
SystemTimeToFileTime (&s, &f);
small_printf ("FILE TIME is %08x%08x\n",