From e9921bcbaa37b9c3df39ef1d8182d56a9db3cb11 Mon Sep 17 00:00:00 2001 From: DJ Delorie Date: Fri, 20 Oct 2000 21:45:50 +0000 Subject: * times.cc (to_time_t): pass zero time as epoch * fhandler.cc (fstat): copy atime/ctime from mtime if they're zero --- winsup/cygwin/times.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'winsup/cygwin/times.cc') diff --git a/winsup/cygwin/times.cc b/winsup/cygwin/times.cc index bff40b612..9960f700b 100644 --- a/winsup/cygwin/times.cc +++ b/winsup/cygwin/times.cc @@ -221,6 +221,11 @@ to_time_t (FILETIME *ptr) long rem; long long x = ((long long) ptr->dwHighDateTime << 32) + ((unsigned)ptr->dwLowDateTime); + + /* pass "no time" as epoch */ + if (x == 0) + return 0; + x -= FACTOR; /* number of 100ns between 1601 and 1970 */ rem = x % ((long long)NSPERSEC); rem += (NSPERSEC / 2); -- cgit v1.2.3