diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2011-05-05 06:45:21 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2011-05-05 06:45:21 +0000 |
commit | 2849cbde549bbc9e66c6b409ee60e47880b11490 (patch) | |
tree | df1deeba7f86b0044cfce66f05fde3fd3c470f55 | |
parent | 5069a2b0d9533b36f55928728d1b1bffedc43545 (diff) | |
download | newlib-2849cbde549bbc9e66c6b409ee60e47880b11490.zip newlib-2849cbde549bbc9e66c6b409ee60e47880b11490.tar.gz newlib-2849cbde549bbc9e66c6b409ee60e47880b11490.tar.bz2 |
* fhandler_registry.cc (fhandler_registry::exists): Fix regression
in EACCES handling.
(fhandler_registry::open): Fix "%val" case.
-rw-r--r-- | winsup/cygwin/ChangeLog | 6 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_registry.cc | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 7daf605..2c78ca5 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2011-05-04 Christian Franke <franke@computer.org> + + * fhandler_registry.cc (fhandler_registry::exists): Fix regression + in EACCES handling. + (fhandler_registry::open): Fix "%val" case. + 2011-05-04 Christopher Faylor <me.cygwin2011@cgf.cx> * signal.cc (_pinfo::kill): Return success on kill(0) only if pid diff --git a/winsup/cygwin/fhandler_registry.cc b/winsup/cygwin/fhandler_registry.cc index f2e80ce..8d3ed2e 100644 --- a/winsup/cygwin/fhandler_registry.cc +++ b/winsup/cygwin/fhandler_registry.cc @@ -317,10 +317,12 @@ fhandler_registry::exists () if (!val_only) hKey = open_key (path, KEY_READ, wow64, false); - if (hKey != (HKEY) INVALID_HANDLE_VALUE || get_errno () == EACCES) + if (hKey != (HKEY) INVALID_HANDLE_VALUE) file_type = virt_directory; else { + /* Key does not exist or open failed with EACCES, + enumerate subkey and value names of parent key. */ hKey = open_key (path, KEY_READ, wow64, true); if (hKey == (HKEY) INVALID_HANDLE_VALUE) return virt_none; @@ -797,7 +799,7 @@ fhandler_registry::open (int flags, mode_t mode) handle = open_key (path, KEY_READ, wow64, false); if (handle == (HKEY) INVALID_HANDLE_VALUE) { - if (get_errno () != EACCES) + if (val_only || get_errno () != EACCES) handle = open_key (path, KEY_READ, wow64, true); if (handle == (HKEY) INVALID_HANDLE_VALUE) { |