From 2be36bd9c4bd7fa7e73821fe902f036f86ab0d0f Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Fri, 17 Mar 2000 17:22:53 +0000 Subject: * fhandler.cc (fhandler_base::open): Call set_file_attribute() only if a file is really created. --- winsup/cygwin/fhandler.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'winsup/cygwin/fhandler.cc') 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 ()); -- cgit v1.2.3