2004-08-14 Pierre Humblet <pierre.humblet@ieee.org>
* fhandler.cc (fhandler_base::open_9x): Set file attributes for new files.
This commit is contained in:
parent
c355ca594b
commit
252dd88138
|
@ -1,3 +1,8 @@
|
|||
2004-08-14 Pierre Humblet <pierre.humblet@ieee.org>
|
||||
|
||||
* fhandler.cc (fhandler_base::open_9x): Set file attributes
|
||||
for new files.
|
||||
|
||||
2004-08-11 Christopher Faylor <cgf@timesys.com>
|
||||
|
||||
* net.cc (cygwin_gethostbyname): Show failing host name on error.
|
||||
|
|
|
@ -480,9 +480,14 @@ fhandler_base::open_9x (int flags, mode_t mode)
|
|||
}
|
||||
#endif
|
||||
|
||||
if (flags & O_CREAT && get_device () == FH_FS)
|
||||
{
|
||||
/* If mode has no write bits set, we set the R/O attribute. */
|
||||
if (!(mode & (S_IWUSR | S_IWGRP | S_IWOTH)))
|
||||
file_attributes |= FILE_ATTRIBUTE_READONLY;
|
||||
/* The file attributes are needed for later use in, e.g. fchmod. */
|
||||
pc.file_attributes (file_attributes & FILE_ATTRIBUTE_VALID_SET_FLAGS);
|
||||
}
|
||||
|
||||
x = CreateFile (get_win32_name (), access, shared, &sa, creation_distribution,
|
||||
file_attributes, 0);
|
||||
|
|
Loading…
Reference in New Issue