This is the mail archive of the
cygwin-patches@cygwin.com
mailing list for the Cygwin project.
[Patch]: Re: CVS commit under windows 98
- From: "Pierre A. Humblet" <pierre at phumblet dot no-ip dot org>
- To: Rob Walker <rob at tenfoot dot org dot uk>,cygwin-patches at cygwin dot com
- Date: Fri, 13 Aug 2004 19:13:26 -0400
- Subject: [Patch]: Re: CVS commit under windows 98
A feature present in open was missing from open9x.
Pierre
2004-08-14 Pierre Humblet <pierre.humblet@ieee.org>
* fhandler.cc (fhandler_base::open_9x): Set file attributes
for new files.
Index: fhandler.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/fhandler.cc,v
retrieving revision 1.201
diff -u -p -r1.201 fhandler.cc
--- fhandler.cc 17 Jun 2004 15:25:09 -0000 1.201
+++ fhandler.cc 13 Aug 2004 23:12:42 -0000
@@ -480,9 +480,14 @@ fhandler_base::open_9x (int flags, 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);