libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Change lt_dlerror to return NULL instaed of "unknown error"


From: Peter O'Gorman
Subject: Re: [PATCH] Change lt_dlerror to return NULL instaed of "unknown error"
Date: Fri, 12 Sep 2003 22:53:33 +0900


On Thursday, September 11, 2003, at 6:56 AM, Scott James Remnant wrote:

[ Patch resubmitted -- ping! :-) ]

This is the behaviour as described in the documentation.  Nothing I've
found relies on the different behaviour in the implementation so this
patch changes it to match the docs.

Hi Scott,

I was just about to use my shiny new commit bit on this, you are of course correct, ltdl should not return LT_DLSTRERROR (UNKNOWN) even if there were no error.

However I realized that it was probably added because there are likely places in the code where an error occurs but the error string is not set. In this case returning NULL from lt_dlerror is also incorrect. I am not about to look through the code looking for places where this happens (it might not even happen as far as I know), but I suggest you modify your patch so that if lt_dlopen, lt_dlsym lt_dlclose are returning failure and the error has not been set then set the unknown error.

Thanks,
Peter

Note: I consider it an error in the application to use dlerror returning NULL as a test for a successful call to dlopen_dlsym or dlclose, these functions all return NULL or -1 in the event of failure, the return codes should be investigated rather than testing dlerror().






reply via email to

[Prev in Thread] Current Thread [Next in Thread]