summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fhandler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/fhandler.cc')
-rw-r--r--winsup/cygwin/fhandler.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc
index 2933a1712..64669da87 100644
--- a/winsup/cygwin/fhandler.cc
+++ b/winsup/cygwin/fhandler.cc
@@ -388,7 +388,8 @@ fhandler_base::fhaccess (int flags)
res = check_file_access (get_win32_name (), flags);
goto done;
}
- else if (get_device () == FH_REGISTRY && allow_ntsec && open (O_RDONLY, 0))
+ else if (get_device () == FH_REGISTRY && allow_ntsec && open (O_RDONLY, 0)
+ && get_handle ())
{
res = check_registry_access (get_handle (), flags);
close ();