OSDN Git Service

* fhandler_disk_file.cc (fhandler_disk_file::fstat): Set st_ctime if
authorcorinna <corinna>
Thu, 17 Feb 2005 12:41:47 +0000 (12:41 +0000)
committercorinna <corinna>
Thu, 17 Feb 2005 12:41:47 +0000 (12:41 +0000)
has_changed flag is set.
(fhandler_disk_file::touch_ctime): Reset has_changed flag on success.

winsup/cygwin/ChangeLog
winsup/cygwin/fhandler_disk_file.cc

index f04afaf..178cf81 100644 (file)
@@ -1,5 +1,11 @@
 2005-02-17  Corinna Vinschen  <corinna@vinschen.de>
 
+       * fhandler_disk_file.cc (fhandler_disk_file::fstat): Set st_ctime if
+       has_changed flag is set.
+       (fhandler_disk_file::touch_ctime): Reset has_changed flag on success.
+
+2005-02-17  Corinna Vinschen  <corinna@vinschen.de>
+
        * times.cc (utimes): Open files with FILE_WRITE_ATTRIBUTES first,
        if that fails, try opeing with GENERIC_WRITE.  Fix comments.
 
index 129e9ce..8644e89 100644 (file)
@@ -374,6 +374,8 @@ fhandler_base::fstat_helper (struct __stat64 *buf,
 int __stdcall
 fhandler_disk_file::fstat (struct __stat64 *buf)
 {
+  if (has_changed ())
+    touch_ctime ();
   return fstat_fs (buf);
 }
 
@@ -387,6 +389,8 @@ fhandler_disk_file::touch_ctime (void)
   SystemTimeToFileTime (&st, &ft);
   if (!SetFileTime (get_io_handle (), &ft, NULL, NULL))
     debug_printf ("SetFileTime (%s) failed, %E", get_win32_name ());
+  else
+    has_changed (false);
 }
 
 int __stdcall