Mail Archives: cygwin-developers/1998/04/16/03:23:04
Sometimes stat() call returns incorrect file modification time (one second less) on fat partitions due to roundup error.
D:\usr\src\cygnus\cdk\winsup>diff -upr times.cc.orig times.cc
--- times.cc.orig Wed Apr 15 10:37:09 1998
+++ times.cc Thu Apr 16 13:50:35 1998
@@ -200,6 +200,7 @@ to_time_t (FILETIME *ptr)
long long x = ((long long) ptr->dwHighDateTime << 32) + ((unsigned)ptr->dwLowDateTime);
x -= FACTOR; /* number of 100ns between 1601 and 1970 */
+ x += NSPERSEC/2; /* avoid round up error */
x /= NSPERSEC; /* number of 100ns in a second */
return x;
}
--
Sergey Okhapkin, http://www.lexa.ru/sos
Moscow, Russia.
- Raw text -