summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/times.cc
diff options
context:
space:
mode:
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);