This is the mail archive of the
cygwin-patches@cygwin.com
mailing list for the Cygwin project.
Re: dlfcn.cc: clear previous dl errors before new dlopen, dlsym, dlclose call?
- From: Christopher Faylor <cgf at redhat dot com>
- To: cygwin-patches at cygwin dot com
- Cc: hzhr at 21cn dot com
- Date: Fri, 31 Jan 2003 23:54:42 -0500
- Subject: Re: dlfcn.cc: clear previous dl errors before new dlopen, dlsym, dlclose call?
- References: <3E2D101A.9090607@21cn.com>
- Reply-to: cygwin-patches at cygwin dot com
On Tue, Jan 21, 2003 at 05:17:14PM +0800, David Huang wrote:
>Is't needed to clear previous dl errors before new dlopen, dlsym,
>dlclose call?
I don't see anything in the documentation which would indicate this.
However, the current implementation seems to be wrong since it always
returns the last load error even when called repeatedly.
SUSv3 says:
"If no dynamic linking errors have occurred since the last invocation of
dlerror(), dlerror() shall return NULL. Thus, invoking dlerror() a
second time, immediately following a prior invocation, shall result in
NULL being returned."
So, I've modified dlerror to do just that.
Thanks for bringing this to our attention.
cgf