From 3419b5bc2b6bf4b6fba63b831aeae92e71410535 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 17 Feb 2005 12:41:49 +0000 Subject: [PATCH] * 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. --- winsup/cygwin/ChangeLog | 6 ++++++ winsup/cygwin/fhandler_disk_file.cc | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index f04afaffc..178cf81d9 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2005-02-17 Corinna Vinschen + + * 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 * times.cc (utimes): Open files with FILE_WRITE_ATTRIBUTES first, diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc index 129e9ce6b..8644e8964 100644 --- a/winsup/cygwin/fhandler_disk_file.cc +++ b/winsup/cygwin/fhandler_disk_file.cc @@ -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