diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2000-03-17 20:22:53 +0300 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2000-03-17 20:22:53 +0300 |
commit | 2be36bd9c4bd7fa7e73821fe902f036f86ab0d0f (patch) | |
tree | 0c91a7342fd58db131989a4be81384eaa5fcfecb | |
parent | af792540a69c8d9551d4aa2f85aa3ee7258d84d3 (diff) |
* fhandler.cc (fhandler_base::open): Call set_file_attribute() only if a file is really created.
-rw-r--r-- | winsup/cygwin/ChangeLog | 6 | ||||
-rw-r--r-- | winsup/cygwin/fhandler.cc | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index ef829504c..e6a509f41 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +Fri Mar 17 18:16:00 2000 Corinna Vinschen <corinna@vinschen.de> + + Patch suggested by Eric Fifer <EFifer@sanwaint.com> + * fhandler.cc (fhandler_base::open): Call set_file_attribute() + only if a file is really created. + Thu Mar 16 14:15:00 2000 Corinna Vinschen <corinna@vinschen.de> * security.cc (set_process_privileges): Remove `static'. diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index 2aba80d7f..d33b60c8c 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -340,7 +340,9 @@ fhandler_base::open (int flags, mode_t mode) goto done; } - if (flags & O_CREAT && get_device () == FH_DISK) + // Attributes may be set only if a file is _really_ created. + if (flags & O_CREAT && get_device () == FH_DISK + && GetLastError () != ERROR_ALREADY_EXISTS) set_file_attribute (has_acls (), get_win32_name (), mode); namehash_ = hash_path_name (0, get_win32_name ()); |