summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fhandler.cc
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2000-10-20 21:45:50 +0000
committerDJ Delorie <dj@redhat.com>2000-10-20 21:45:50 +0000
commite9921bcbaa37b9c3df39ef1d8182d56a9db3cb11 (patch)
tree69d55350b85b0356d98a63bf1c019188153e71e5 /winsup/cygwin/fhandler.cc
parentb3c74e6dd026e919d5a2b0abd820ae432fb866c8 (diff)
downloadcygnal-e9921bcbaa37b9c3df39ef1d8182d56a9db3cb11.tar.gz
cygnal-e9921bcbaa37b9c3df39ef1d8182d56a9db3cb11.tar.bz2
cygnal-e9921bcbaa37b9c3df39ef1d8182d56a9db3cb11.zip
* 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/fhandler.cc')
-rw-r--r--winsup/cygwin/fhandler.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc
index f6ce3adf9..1a7835d60 100644
--- a/winsup/cygwin/fhandler.cc
+++ b/winsup/cygwin/fhandler.cc
@@ -855,6 +855,12 @@ fhandler_disk_file::fstat (struct stat *buf)
buf->st_dev = local.dwVolumeSerialNumber;
buf->st_size = local.nFileSizeLow;
+ /* This is for FAT filesystems, which don't support atime/ctime */
+ if (buf->st_atime == 0)
+ buf->st_atime = buf->st_mtime;
+ if (buf->st_ctime == 0)
+ buf->st_ctime = buf->st_mtime;
+
/* Allocate some place to determine the root directory. Need to allocate
enough so that rootdir can add a trailing slash if path starts with \\. */
char root[strlen (get_win32_name ()) + 3];