From a5a93a62b2e1f8b13d20f72f0d1a6f5266c05c37 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sat, 1 Feb 2003 05:00:15 +0000 Subject: [PATCH] * dlfcn.cc (dlerror): Only report load errors once per error. --- winsup/cygwin/ChangeLog | 4 ++++ winsup/cygwin/dlfcn.cc | 13 +++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 9f1527aee..80e8c9f44 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +2003-01-31 Christopher Faylor + + * dlfcn.cc (dlerror): Only report load errors once per error. + 2003-01-31 Christopher Faylor * fhandler_serial.cc (fhandler_serial::open): Avoid extraneous setting diff --git a/winsup/cygwin/dlfcn.cc b/winsup/cygwin/dlfcn.cc index b6babe66b..b03f685fc 100644 --- a/winsup/cygwin/dlfcn.cc +++ b/winsup/cygwin/dlfcn.cc @@ -144,8 +144,13 @@ dlclose (void *handle) char * dlerror () { - char *ret = 0; - if (_dl_error) - ret = _dl_buffer; - return ret; + char *res; + if (!_dl_error) + res = NULL; + else + { + _dl_error = 0; + res = _dl_buffer; + } + return res; }