diff options
Diffstat (limited to 'winsup/cygwin/fhandler_registry.cc')
-rw-r--r-- | winsup/cygwin/fhandler_registry.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/winsup/cygwin/fhandler_registry.cc b/winsup/cygwin/fhandler_registry.cc index c45dc1c71..cfe4c0712 100644 --- a/winsup/cygwin/fhandler_registry.cc +++ b/winsup/cygwin/fhandler_registry.cc @@ -256,7 +256,7 @@ fhandler_registry::exists () if (!val_only) hKey = open_key (path, KEY_READ, wow64, false); - if (hKey != (HKEY) INVALID_HANDLE_VALUE) + if (hKey != (HKEY) INVALID_HANDLE_VALUE || get_errno () == EACCES) file_type = 1; else { @@ -683,7 +683,8 @@ fhandler_registry::open (int flags, mode_t mode) handle = open_key (path, KEY_READ, wow64, false); if (handle == (HKEY) INVALID_HANDLE_VALUE) { - handle = open_key (path, KEY_READ, wow64, true); + if (get_errno () != EACCES) + handle = open_key (path, KEY_READ, wow64, true); if (handle == (HKEY) INVALID_HANDLE_VALUE) { res = 0; |