aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/fhandler_registry.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2008-12-15 12:51:46 +0000
committerCorinna Vinschen <corinna@vinschen.de>2008-12-15 12:51:46 +0000
commit645298660173d29ccaffe69c64430a4bc212d663 (patch)
treee6486af3a8ef88070872ab74be50f9053651f817 /winsup/cygwin/fhandler_registry.cc
parentf8a41da921a0c42e3fb2740b175c74261323f9ec (diff)
downloadnewlib-645298660173d29ccaffe69c64430a4bc212d663.zip
newlib-645298660173d29ccaffe69c64430a4bc212d663.tar.gz
newlib-645298660173d29ccaffe69c64430a4bc212d663.tar.bz2
* fhandler_registry.cc (fhandler_registry::exists): Handle EACCES.
(fhandler_registry::open): Ditto.
Diffstat (limited to 'winsup/cygwin/fhandler_registry.cc')
-rw-r--r--winsup/cygwin/fhandler_registry.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/winsup/cygwin/fhandler_registry.cc b/winsup/cygwin/fhandler_registry.cc
index c45dc1c..cfe4c07 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;