Date: Thu, 01 Mar 2001 21:58:36 +0200 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: "Mark E." 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 Precedence: bulk > From: "Mark E." > 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?