summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fhandler.h
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2005-02-11 15:37:26 +0000
committerCorinna Vinschen <corinna@vinschen.de>2005-02-11 15:37:26 +0000
commit8be730bbb14e0924efe5c560f0a4b07af5c653eb (patch)
treeec6e0a440fe9b8186f887474eb6f1ed6056ea92c /winsup/cygwin/fhandler.h
parentcc9440b6f42536f9f3b3fca6a6c53155792a51eb (diff)
downloadcygnal-8be730bbb14e0924efe5c560f0a4b07af5c653eb.tar.gz
cygnal-8be730bbb14e0924efe5c560f0a4b07af5c653eb.tar.bz2
cygnal-8be730bbb14e0924efe5c560f0a4b07af5c653eb.zip
* fhandler.cc (fhandler_base::raw_write): Mark as changed on
successful write. * fhandler.h (fhandler_base::status_flags): Add 'has_changed' flag. * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Call fhandler_disk_file's own open and close instead of open_fs and close_fs. Mark as changed on success. (fhandler_disk_file::fchown): Ditto. (fhandler_disk_file::facl): Ditto. (fhandler_disk_file::ftruncate): Ditto. (fhandler_base::open_fs): Mark as changed when O_TRUNC flag on existing file is set. (fhandler_disk_file::close): Set st_ctime if has_changed flag is set.
Diffstat (limited to 'winsup/cygwin/fhandler.h')
-rw-r--r--winsup/cygwin/fhandler.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h
index 2f2f01706..8a871cb8b 100644
--- a/winsup/cygwin/fhandler.h
+++ b/winsup/cygwin/fhandler.h
@@ -91,12 +91,14 @@ class fhandler_base
read or write access */
unsigned close_on_exec : 1; /* close-on-exec */
unsigned need_fork_fixup : 1; /* Set if need to fixup after fork. */
+ unsigned has_changed : 1; /* Flag used to set ctime on close. */
public:
status_flags () :
rbinary (0), rbinset (0), wbinary (0), wbinset (0), nohandle (0),
uninterruptible_io (0), append_mode (0), did_lseek (0),
- query_open (no_query), close_on_exec (0), need_fork_fixup (0)
+ query_open (no_query), close_on_exec (0), need_fork_fixup (0),
+ has_changed (0)
{}
} status, open_status;
@@ -177,6 +179,7 @@ class fhandler_base
IMPLEMENT_STATUS_FLAG (query_state, query_open)
IMPLEMENT_STATUS_FLAG (bool, close_on_exec)
IMPLEMENT_STATUS_FLAG (bool, need_fork_fixup)
+ IMPLEMENT_STATUS_FLAG (bool, has_changed)
int get_default_fmode (int flags);