]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Remove redundant lt_dlerror() calls
authorOndřej Surý <ondrej@sury.org>
Mon, 26 Oct 2020 10:14:49 +0000 (11:14 +0100)
committerMichał Kępień <michal@isc.org>
Wed, 28 Oct 2020 14:48:58 +0000 (15:48 +0100)
The redundant lt_dlerror() calls were taken from the examples to clean
any previous errors from lt_dl...() calls.  However upon code
inspection, it was discovered there are no such paths that could cause
the lt_dlerror() to return spurious error messages.

bin/named/unix/dlz_dlopen_driver.c
lib/dns/dyndb.c
lib/ns/hooks.c

index be9055ec10214ca18ccfd6f568e57da5e2876e2d..fb9ce8d459ff0927c2784953470e4df0a706a5d7 100644 (file)
@@ -193,8 +193,7 @@ dl_load_symbol(dlopen_data_t *cd, const char *symbol, bool mandatory) {
                                   cd->dl_path, symbol, errmsg);
                }
        }
-       /* Cleanup any errors */
-       (void)lt_dlerror();
+
        return (ptr);
 }
 
@@ -243,8 +242,6 @@ dlopen_dlz_create(const char *dlzname, unsigned int argc, char *argv[],
                goto failed;
        }
 
-       (void)lt_dlerror();
-
        /* Find the symbols */
        cd->dlz_version =
                (dlz_dlopen_version_t *)dl_load_symbol(cd, "dlz_version", true);
index f70723c3a296eef2c0c16cd6a595cee8f5bfef1c..e35293ece62154b4478826547a02eb2c49c99667 100644 (file)
@@ -99,7 +99,6 @@ load_symbol(lt_dlhandle handle, const char *filename, const char *symbol_name,
                              symbol_name, filename, errmsg);
                return (ISC_R_FAILURE);
        }
-       (void)lt_dlerror();
 
        *symbolp = symbol;
 
@@ -132,9 +131,6 @@ load_library(isc_mem_t *mctx, const char *filename, const char *instname,
                CHECK(ISC_R_FAILURE);
        }
 
-       /* Clear dlerror */
-       (void)lt_dlerror();
-
        CHECK(load_symbol(handle, filename, "dyndb_version",
                          (void **)&version_func));
 
index 5bd1efb8b44b269bfad858d656e84b6579f3f23f..f79ef1b47bbdf7d9c25483b15024e80e4929400c 100644 (file)
@@ -98,14 +98,6 @@ load_symbol(void *handle, const char *modpath, const char *symbol_name,
        REQUIRE(handle != NULL);
        REQUIRE(symbolp != NULL && *symbolp == NULL);
 
-       /*
-        * Clear any pre-existing error conditions before running dlsym().
-        * (In this case, we expect dlsym() to return non-NULL values
-        * and will always return an error if it returns NULL, but
-        * this ensures that we'll report the correct error condition
-        * if there is one.)
-        */
-       lt_dlerror();
        symbol = lt_dlsym(handle, symbol_name);
        if (symbol == NULL) {
                const char *errmsg = lt_dlerror();