Hi,

There was an error report on the Debian bug tracking system
that lt_dlopenext() sets an error on succesful loading the library
if no extention was given.  See:
http://bugs.debian.org/510006

Here are the patches I've made for both the 1.5 and 2.2 branch.


PS: Can somebody fix the example in autobook?

Kurt

diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c
index b747b70..e619c94 100644
--- a/libltdl/ltdl.c
+++ b/libltdl/ltdl.c
@@ -3491,6 +3491,9 @@ lt_dlopenext (filename)
   char *	ext		= 0;
   size_t	len;
   int		errors		= 0;
+  const char *	saved_error	= 0;
+
+  LT_DLMUTEX_GETERROR (saved_error);
 
   if (!filename)
     {
@@ -3534,6 +3537,7 @@ lt_dlopenext (filename)
     }
 
 #ifdef LTDL_SHLIB_EXT
+  LT_DLMUTEX_SETERROR (saved_error);
   /* Try appending SHLIB_EXT.   */
   if (LT_STRLEN (shlib_ext) > LT_STRLEN (archive_ext))
     {
diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c
index 6e19599..80b5675 100644
--- a/libltdl/ltdl.c
+++ b/libltdl/ltdl.c
@@ -1614,6 +1614,9 @@ lt_dlopenadvise (const char *filename, lt_dladvise advise)
 {
   lt_dlhandle	handle	= 0;
   int		errors	= 0;
+  const char *	saved_error	= 0;
+
+  LT__GETERROR (saved_error);
 
   /* Can't have symbols hidden and visible at the same time!  */
   if (advise && advise->is_symlocal && advise->is_symglobal)
@@ -1650,6 +1653,7 @@ lt_dlopenadvise (const char *filename, lt_dladvise advise)
 
 #if defined(LT_MODULE_EXT)
       /* Try appending SHLIB_EXT.   */
+      LT__SETERRORSTR (saved_error);
       errors = try_dlopen (&handle, filename, shlib_ext, advise);
 
       /* As before, if the file was found but loading failed, return now

Reply via email to