OSDN Git Service

* fhandler_process.cc (fhandler_process::open): Allow opening of
authorcorinna <corinna>
Mon, 8 Aug 2005 15:33:25 +0000 (15:33 +0000)
committercorinna <corinna>
Mon, 8 Aug 2005 15:33:25 +0000 (15:33 +0000)
/proc/<pid>/fd for reading.
* fhandler_registry.cc (fhandler_registry::open): Ditto for registry
keys.

winsup/cygwin/ChangeLog
winsup/cygwin/fhandler_process.cc
winsup/cygwin/fhandler_registry.cc

index 78cb051..8db3f4e 100644 (file)
@@ -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.
index 7dca217..127c91e 100644 (file)
@@ -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)
     {
index 41ff072..07be1d0 100644 (file)
@@ -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;