summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--winsup/cygwin/ChangeLog4
-rw-r--r--winsup/cygwin/fhandler.cc25
2 files changed, 23 insertions, 6 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 873e11986..0ab6b8f12 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,7 @@
+2005-03-04 Corinna Vinschen <corinna@vinschen.de>
+
+ * fhandler.cc (fhandler_base::open_9x): Satisfy query_open values.
+
2005-03-04 Pierre Humblet <pierre.humblet@ieee.org>
* fhandler_socket.cc (fhandler_socket::ioctl): Only cancel
diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc
index b2bacb5d3..046e81fd7 100644
--- a/winsup/cygwin/fhandler.cc
+++ b/winsup/cygwin/fhandler.cc
@@ -449,12 +449,25 @@ fhandler_base::open_9x (int flags, mode_t mode)
syscall_printf ("(%s, %p)", get_win32_name (), flags);
- if ((flags & (O_RDONLY | O_WRONLY | O_RDWR)) == O_RDONLY)
- access = GENERIC_READ;
- else if ((flags & (O_RDONLY | O_WRONLY | O_RDWR)) == O_WRONLY)
- access = GENERIC_WRITE;
- else
- access = GENERIC_READ | GENERIC_WRITE;
+ switch (query_open ())
+ {
+ case query_read_control:
+ case query_stat_control:
+ access = GENERIC_READ;
+ break;
+ case query_write_control:
+ case query_write_attributes:
+ access = GENERIC_READ | FILE_WRITE_ATTRIBUTES;
+ break;
+ default:
+ if ((flags & (O_RDONLY | O_WRONLY | O_RDWR)) == O_RDONLY)
+ access = GENERIC_READ;
+ else if ((flags & (O_RDONLY | O_WRONLY | O_RDWR)) == O_WRONLY)
+ access = GENERIC_WRITE;
+ else
+ access = GENERIC_READ | GENERIC_WRITE;
+ break;
+ }
if ((flags & O_TRUNC) && ((flags & O_ACCMODE) != O_RDONLY))
{