]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libltdl/ltdl.c (tryall_dlopen): Abort with
authorGary V. Vaughan <gary@gnu.org>
Mon, 17 Jan 2000 15:21:33 +0000 (15:21 +0000)
committerGary V. Vaughan <gary@gnu.org>
Mon, 17 Jan 2000 15:21:33 +0000 (15:21 +0000)
file_not_found_error before trying all lib_open() methods
if the file to be dlopened doesn't exist.
* ltdl.m4 (AC_HAVE_HEADERS): add unistd.h.

ChangeLog
libltdl/ltdl.c
ltdl.m4

index f50e86b568f2ba291061abcbfa6e2ee0b2602e03..b967f0cece30b4b437abf3cc8f7dc938f54f566a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2000-01-17  Gary V. Vaughan  <gary@oranda.demon.co.uk>
+
+       * libltdl/ltdl.c (tryall_dlopen): Abort with
+       file_not_found_error before trying all lib_open() methods
+       if the file to be dlopened doesn't exist.
+       * ltdl.m4 (AC_HAVE_HEADERS): add unistd.h.
+
 2000-01-16  Gary V. Vaughan  <gary@oranda.demon.co.uk>
 
        * libltdl/ltdl.c (find_file): memory error fixed.
index d06fee2f938ee8aebc8698781e0c7e0fda9ccce6..901991d036a980240e3e372a233d990357dc9ea0 100644 (file)
@@ -54,6 +54,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 #include <stdlib.h>
 #endif
 
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
 #if HAVE_STDIO_H
 #include <stdio.h>
 #endif
@@ -940,6 +944,10 @@ tryall_dlopen (handle, filename)
                }
        } else
                cur->info.filename = 0;
+       if (access (filename, F_OK) < 0) {
+               last_error = file_not_found_error;
+               return 1;
+       }
        while (type) {
                if (type->lib_open(cur, filename) == 0)
                        break;
diff --git a/ltdl.m4 b/ltdl.m4
index 84e1c667cdaebcddb42adf2f9c3c0c8b97955bb6..12961f95d0e3ff1e1c1a11cbcc209201213141bc 100644 (file)
--- a/ltdl.m4
+++ b/ltdl.m4
@@ -33,7 +33,7 @@ dnl of the ltdl objects -- including compiler checks (above) and header
 dnl checks (below).
 AC_REQUIRE([AC_HEADER_STDC])dnl
 
-AC_CHECK_HEADERS(malloc.h memory.h stdlib.h stdio.h ctype.h dlfcn.h dl.h dld.h)
+AC_CHECK_HEADERS(malloc.h memory.h stdlib.h stdio.h unistd.h ctype.h dlfcn.h dl.h dld.h)
 AC_CHECK_HEADERS(string.h strings.h, break)
 AC_CHECK_FUNCS(strchr index, break)
 AC_CHECK_FUNCS(strrchr rindex, break)