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:
authorDJ Delorie <dj@redhat.com>2000-10-21 01:45:50 +0400
committerDJ Delorie <dj@redhat.com>2000-10-21 01:45:50 +0400
commite9921bcbaa37b9c3df39ef1d8182d56a9db3cb11 (patch)
tree69d55350b85b0356d98a63bf1c019188153e71e5 /winsup/cygwin/times.cc
parentb3c74e6dd026e919d5a2b0abd820ae432fb866c8 (diff)
* times.cc (to_time_t): pass zero time as epoch
* fhandler.cc (fstat): copy atime/ctime from mtime if they're zero
Diffstat (limited to 'winsup/cygwin/times.cc')
-rw-r--r--winsup/cygwin/times.cc5
1 files changed, 5 insertions, 0 deletions
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);