From 2b749986add04350de7a54cd1456dc65ec427f16 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 29 Apr 2010 13:03:30 +0000 Subject: [PATCH] * dlfcn.cc (get_full_path_of_dll): Handle non-existent file. --- winsup/cygwin/ChangeLog | 4 ++++ winsup/cygwin/dlfcn.cc | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index f70e2cd2d..5a0efa9df 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +2010-04-29 Corinna Vinschen + + * dlfcn.cc (get_full_path_of_dll): Handle non-existent file. + 2010-04-29 Corinna Vinschen * mount.cc (struct opt): Add "dos" and "ihash" options. diff --git a/winsup/cygwin/dlfcn.cc b/winsup/cygwin/dlfcn.cc index fb3df2c5f..f63956365 100644 --- a/winsup/cygwin/dlfcn.cc +++ b/winsup/cygwin/dlfcn.cc @@ -58,10 +58,10 @@ get_full_path_of_dll (const char* str, path_conv &real_filename) ?: check_path_access ("/usr/lib", name, real_filename)) == NULL) real_filename.check (name, PC_SYM_FOLLOW | PC_NOFULL | PC_NULLEMPTY); - if (!real_filename.error) + if (!real_filename.error && real_filename.exists ()) return true; - set_errno (real_filename.error); + set_errno (real_filename.error ?: ENOENT); return false; }