Mail Archives: cygwin-developers/1998/05/13/18:20:07
Sergey Okhapkin wrote:
>
> 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;
> }
I committed this patch.
--
Geoffrey Noer
noer AT cygnus DOT com
- Raw text -