summaryrefslogtreecommitdiffstats
path: root/winsup
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2005-08-08 15:33:32 +0000
committerCorinna Vinschen <corinna@vinschen.de>2005-08-08 15:33:32 +0000
commitaf925fe4fa59ce9eabcc8d18f0bd001b28592ec3 (patch)
tree663e515aa6a076ccbf44b99c7bdf0fa5a935ad7e /winsup
parent6e8cac26380d953765edf32a1f2865ebc342501e (diff)
downloadcygnal-af925fe4fa59ce9eabcc8d18f0bd001b28592ec3.tar.gz
cygnal-af925fe4fa59ce9eabcc8d18f0bd001b28592ec3.tar.bz2
cygnal-af925fe4fa59ce9eabcc8d18f0bd001b28592ec3.zip
* fhandler_process.cc (fhandler_process::open): Allow opening of
/proc/<pid>/fd for reading. * fhandler_registry.cc (fhandler_registry::open): Ditto for registry keys.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog7
-rw-r--r--winsup/cygwin/fhandler_process.cc5
-rw-r--r--winsup/cygwin/fhandler_registry.cc14
3 files changed, 19 insertions, 7 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 78cb05172..8db3f4e44 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,10 @@
+2005-08-08 Corinna Vinschen <corinna@vinschen.de>
+
+ * fhandler_process.cc (fhandler_process::open): Allow opening of
+ /proc/<pid>/fd for reading.
+ * fhandler_registry.cc (fhandler_registry::open): Ditto for registry
+ keys.
+
2005-08-08 Christopher Faylor <cgf@timesys.com>
* include/sys/cdefs.h (__CONCAT): Define.
diff --git a/winsup/cygwin/fhandler_process.cc b/winsup/cygwin/fhandler_process.cc
index 7dca21747..127c91e51 100644
--- a/winsup/cygwin/fhandler_process.cc
+++ b/winsup/cygwin/fhandler_process.cc
@@ -293,9 +293,8 @@ fhandler_process::open (int flags, mode_t mode)
}
if (process_file_no == PROCESS_FD)
{
- set_errno (EISDIR);
- res = 0;
- goto out;
+ flags |= O_DIROPEN;
+ goto success;
}
if (flags & O_WRONLY)
{
diff --git a/winsup/cygwin/fhandler_registry.cc b/winsup/cygwin/fhandler_registry.cc
index 41ff072a2..07be1d0c7 100644
--- a/winsup/cygwin/fhandler_registry.cc
+++ b/winsup/cygwin/fhandler_registry.cc
@@ -484,12 +484,18 @@ fhandler_registry::open (int flags, mode_t mode)
goto out;
}
- handle = open_key (path, KEY_READ, true);
+ handle = open_key (path, KEY_READ, false);
if (handle == (HKEY) INVALID_HANDLE_VALUE)
{
- res = 0;
- goto out;
+ handle = open_key (path, KEY_READ, true);
+ if (handle == (HKEY) INVALID_HANDLE_VALUE)
+ {
+ res = 0;
+ goto out;
+ }
}
+ else
+ flags |= O_DIROPEN;
set_io_handle (handle);
@@ -498,7 +504,7 @@ fhandler_registry::open (int flags, mode_t mode)
else
value_name = cstrdup (file);
- if (!fill_filebuf ())
+ if (!(flags & O_DIROPEN) && !fill_filebuf ())
{
RegCloseKey (handle);
res = 0;