https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255698

--- Comment #5 from Eugene M. Kim <[email protected]> ---
Hi Konstantin, thank you for fixing this!  I rebuilt my world and the dltest
program now outputs this:

dlerror()=0x8002227f0 ()
dlerror()=0x0
dlopen(/foobar.so, RTLD_NOW)=0x0
dlerror()=0x8002227f0 (Cannot open "/foobar.so")
dlerror()=0x0
dlopen(/usr/lib/libm.so, RTLD_NOW)=0x800226808
dlerror()=0x0
dlerror()=0x0

This is very close to the expected output, except the first call to dlerror()
still returns a non-NULL (albeit empty) message, instead of NULL.  The wording
of dlerror(3) makes me believe that returning NULL is more appropriate in this
case: "The dlerror() function returns a null-terminated character string
describing the last error that occurred during a call to dlopen(), dladdr(),
dlinfo(), dlsym(), dlvsym(), dlfunc(), or dlclose(). If no such error has
occurred, dlerror() returns a null pointer."

>From practical POV, your fix does address the use case where callers check for
errors using dlerror() == NULL, as such checks always occur after a call to one
of those other functions.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"

Reply via email to