This is the mail archive of the cygwin-developers@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Problem with open() and O_CREAT


"Fifer, Eric" wrote:
> [...]
> Anyway, the simplified patch now becomes:
> 
> diff -rup winsup.orig/cygwin/fhandler.cc winsup/cygwin/fhandler.cc
> --- winsup.orig/cygwin/fhandler.cc      Fri Mar 17 04:55:11 2000
> +++ winsup/cygwin/fhandler.cc   Fri Mar 17 13:41:07 2000
> @@ -340,7 +340,8 @@ fhandler_base::open (int flags, mode_t m
>        goto done;
>      }
> 
> -  if (flags & O_CREAT && get_device () == FH_DISK)
> +  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 ());

Thanks again, Eric.

I have only slightly reformatted your patch and added a comment.

Corinna

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]