Mail Archives: djgpp-workers/2001/03/01/14:58:57
> 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 -