]> sourceware.org Git - newlib-cygwin.git/commitdiff
* times.cc (to_time_t): Always round time_t down to nearest second.
authorChristopher Faylor <me@cgf.cx>
Thu, 25 Jul 2002 15:59:49 +0000 (15:59 +0000)
committerChristopher Faylor <me@cgf.cx>
Thu, 25 Jul 2002 15:59:49 +0000 (15:59 +0000)
winsup/cygwin/ChangeLog
winsup/cygwin/times.cc

index 9b8d20ff0cf792bc96b6d40c192b3b0f048b44c1..e45e93d7d19de3c898459bc99975daf873cbf286 100644 (file)
@@ -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 
index 7a9a3eb33009c3186b674c403c354fdb69c5e5bb..a7dec6a9b9435975e27ab11bb86e867fd9933858 100644 (file)
@@ -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;
 }
 
This page took 0.036934 seconds and 5 git commands to generate.