On Mon, Dec 29, 2008 at 05:49:55PM +0100, Kurt Roeckx wrote:
> 
> - lt_dlerror() returns a "file not found" error, while the call
>   was succesful.  It looks like ltdl shouldn't have returned
>   that error.  Not sure how easy that is to fix.

Here is are 2 patches.  One applies to the versin in stable/testing/unstable
(1.5) the other to the version in experimental (2.2).


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