Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2005-03-04 16:54:59 +0300
committerCorinna Vinschen <corinna@vinschen.de>2005-03-04 16:54:59 +0300
commit0f63e6247d6fb47580ae24200279f7c23bb9a22e (patch)
treec8f20e2c59ef7458efa312299fad65c951e46835
parentf317a917bc7e669a130893db5dc32a7d620662ad (diff)
* fhandler.cc (fhandler_base::open_9x): Satisfy query_open values.
-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))
{