delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/2000/03/17/12:23:17

Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-developers-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin-developers/>
List-Post: <mailto:cygwin-developers AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-developers-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-developers-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin-developers AT sourceware DOT cygnus DOT com
Message-ID: <38D269FA.CC6EA97D@vinschen.de>
Date: Fri, 17 Mar 2000 18:23:06 +0100
From: Corinna Vinschen <corinna AT vinschen DOT de>
Reply-To: cygwin-developers AT sourceware DOT cygnus DOT com
X-Mailer: Mozilla 4.72 [en] (Windows NT 5.0; U)
X-Accept-Language: de,en
MIME-Version: 1.0
To: "Fifer, Eric" <EFifer AT sanwaint DOT com>
CC: cygwin-developers AT sourceware DOT cygnus DOT com
Subject: Re: Problem with open() and O_CREAT
References: <779F20BCCE5AD31186A50008C75D9979171704 AT SILLDN_MAIL1>

"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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019