Den 2010-01-02 04:02 skrev Peter Rosin:
Hi!

Please consider the attached patch.

I'm just about to go skiing for a week or so, so I'll push when I get
back if this patch is blessed (knock wood) after I leave...

Here a followup patch that takes care of a problem with the error
reporting patch in the previous message.

Cheers,
Peter

2010-01-02  Peter Rosin  <p...@lysator.liu.se>

        Handle simulated errors correctly.
        * libltdl/loaders/loadlibrary.c (vm_open): Don't go fishing
        for a Windows error message when the error is simulated.

diff --git a/libltdl/loaders/loadlibrary.c b/libltdl/loaders/loadlibrary.c
index 3c08f2e..3e65212 100644
--- a/libltdl/loaders/loadlibrary.c
+++ b/libltdl/loaders/loadlibrary.c
@@ -218,9 +218,11 @@ vm_open (lt_user_data LT__UNUSED loader_data, const char 
*filename,
           }
       }
 
-    if (cur || !module)
+    if (!module)
+      LOADLIB_SETERROR (CANNOT_OPEN);
+    else if (cur)
       {
-        LOADLIB_SETERROR (CANNOT_OPEN);
+        LT__SETERROR (CANNOT_OPEN);
         module = 0;
       }
   }

Reply via email to