From: Nadav Har'El <[email protected]>
Committer: Nadav Har'El <[email protected]>
Branch: master

dladdr() fix return value (again)

It was a mistake to check whether base is 0, because base may actually be 0
for the kernel module... Rather we need to check if fname is 0.

Without this patch, tst-dlfcn.cc fails.

Signed-off-by: Nadav Har'El <[email protected]>

---
diff --git a/libc/dlfcn.cc b/libc/dlfcn.cc
--- a/libc/dlfcn.cc
+++ b/libc/dlfcn.cc
@@ -127,7 +127,7 @@ extern "C" int dladdr(void *addr, Dl_info *info)
// shared object. It should return 1 when we were able to find the object
     // (dli_fname, dli_fbase) even if we couldn't find the specific symbol
     // (dli_sname, dli_saddr).
-    return ei.base ? 1 : 0;
+    return ei.fname ? 1 : 0;
 }

 extern "C" char *dlerror(void)

--
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to