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:
Pierre Humblet 2004-08-14 03:01:21 +00:00
parent c355ca594b
commit 252dd88138
2 changed files with 13 additions and 3 deletions

View File

@ -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.

View File

@ -480,9 +480,14 @@ fhandler_base::open_9x (int flags, mode_t mode)
}
#endif
/* 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;
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);