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:
authorChristopher Faylor <me@cgf.cx>2002-07-25 19:59:49 +0400
committerChristopher Faylor <me@cgf.cx>2002-07-25 19:59:49 +0400
commitbe18721ec44326fcfb44c2ec3c4363e48ed10a79 (patch)
treea9c1f5c6e4306dda4511215e7c7e31a556c80c58 /winsup/cygwin
parent1ceb2460dbe991cdaf01f43509ab516cbd854df1 (diff)
* times.cc (to_time_t): Always round time_t down to nearest second.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r--winsup/cygwin/ChangeLog4
-rw-r--r--winsup/cygwin/times.cc4
2 files changed, 4 insertions, 4 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 9b8d20ff0..e45e93d7d 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,7 @@
+2002-07-24 David MacMahon <davidm@smartsc.com>
+
+ * times.cc (to_time_t): Always round time_t down to nearest second.
+
2002-07-25 Egor Duda <deo@logos-m.ru>
* Makefile.in: Check if API version is updated when exports are
diff --git a/winsup/cygwin/times.cc b/winsup/cygwin/times.cc
index 7a9a3eb33..a7dec6a9b 100644
--- a/winsup/cygwin/times.cc
+++ b/winsup/cygwin/times.cc
@@ -212,7 +212,6 @@ to_time_t (FILETIME *ptr)
stuffed into two long words.
A time_t is the number of seconds since jan 1 1970. */
- long rem;
long long x = ((long long) ptr->dwHighDateTime << 32) + ((unsigned)ptr->dwLowDateTime);
/* pass "no time" as epoch */
@@ -220,10 +219,7 @@ to_time_t (FILETIME *ptr)
return 0;
x -= FACTOR; /* number of 100ns between 1601 and 1970 */
- rem = x % ((long long)NSPERSEC);
- rem += (NSPERSEC / 2);
x /= (long long) NSPERSEC; /* number of 100ns in a second */
- x += (long long) (rem / NSPERSEC);
return x;
}