delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/03/01/14:58:57

Date: Thu, 01 Mar 2001 21:58:36 +0200
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: "Mark E." <snowball3 AT bigfoot DOT com>
Message-Id: <7458-Thu01Mar2001215836+0200-eliz@is.elta.co.il>
X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.6
CC: djgpp-workers AT delorie DOT com
In-reply-to: <3A9E3DF4.25576.8B4E27@localhost> (snowball3@bigfoot.com)
Subject: Re: O_TEMPORARY v3
References: <3A9D30A6 DOT 22494 DOT 7A725 AT localhost> <3A9E3DF4 DOT 25576 DOT 8B4E27 AT localhost>
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> From: "Mark E." <snowball3 AT bigfoot DOT com>
> Date: Thu, 1 Mar 2001 12:17:56 -0500
> 
> __set_fd_properties can handle being called multiple times, so I suggest 
> treating it much like __file_handle_set:
[snip]
>     if (should_create)
> +   {
>       fd = _creatnew(real_name, dmode, oflag & 0xff);
> +     __set_fd_properties(fd, real_name, oflag);
> +   }
>     else
>     {
>       fd = _open(real_name, oflag);
> *************** open(const char* filename, int oflag, ..
> *** 132,138 ****
>         /* Don't call _creat on existing files for which _open fails,
>            since the file could be truncated as a result.  */
>         else if ((oflag & O_CREAT))
> ! 	fd = _creat(real_name, dmode);
>       }
>     }
>   
> --- 137,147 ----
>         /* Don't call _creat on existing files for which _open fails,
>            since the file could be truncated as a result.  */
>         else if ((oflag & O_CREAT))
> !       {
> !         fd = _creat(real_name, dmode);
> !         if (fd != -1)
> !           __set_fd_properties(fd, real_name, oflag);
> !       }
>       }
>     }

This is okay, but it means that an application cannot open an
O_TEMPORARY file via _open or _creatnew.  Is that what we want?

- Raw text -


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