[PATCH 1/5] Only call dlerror() when dlsym() fails.

Thomas Klausner tk at giga.or.at
Sat Oct 27 19:56:07 CEST 2012


From: Thomas Klausner <wiz at NetBSD.org>

State of dlerror() is undefined otherwise, at least on NetBSD.
---
 cipher/idea-stub.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cipher/idea-stub.c b/cipher/idea-stub.c
index 8996c75..c8036a4 100644
--- a/cipher/idea-stub.c
+++ b/cipher/idea-stub.c
@@ -131,9 +131,9 @@ load_module (const char *name)
     }
 
   sym = dlsym (handle, "idea_get_info");
-  if (dlerror ())
+  if ((sym == NULL) && dlerror())
     sym = dlsym (handle, "_idea_get_info");
-  if ((err=dlerror())) 
+  if ((sym == NULL) && (err=dlerror()))
     goto failure;
 
   return (INFO_FNC)sym;
-- 
1.7.12.2




More information about the Gnupg-devel mailing list