mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-02 07:35:26 +00:00
Remove redundant lt_dlerror() calls
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.
This commit is contained in:
committed by
Michał Kępień
parent
e06972eb2f
commit
0f49b02fc5
@@ -193,8 +193,7 @@ dl_load_symbol(dlopen_data_t *cd, const char *symbol, bool mandatory) {
|
|||||||
cd->dl_path, symbol, errmsg);
|
cd->dl_path, symbol, errmsg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Cleanup any errors */
|
|
||||||
(void)lt_dlerror();
|
|
||||||
return (ptr);
|
return (ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -243,8 +242,6 @@ dlopen_dlz_create(const char *dlzname, unsigned int argc, char *argv[],
|
|||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
(void)lt_dlerror();
|
|
||||||
|
|
||||||
/* Find the symbols */
|
/* Find the symbols */
|
||||||
cd->dlz_version =
|
cd->dlz_version =
|
||||||
(dlz_dlopen_version_t *)dl_load_symbol(cd, "dlz_version", true);
|
(dlz_dlopen_version_t *)dl_load_symbol(cd, "dlz_version", true);
|
||||||
|
@@ -99,7 +99,6 @@ load_symbol(lt_dlhandle handle, const char *filename, const char *symbol_name,
|
|||||||
symbol_name, filename, errmsg);
|
symbol_name, filename, errmsg);
|
||||||
return (ISC_R_FAILURE);
|
return (ISC_R_FAILURE);
|
||||||
}
|
}
|
||||||
(void)lt_dlerror();
|
|
||||||
|
|
||||||
*symbolp = symbol;
|
*symbolp = symbol;
|
||||||
|
|
||||||
@@ -132,9 +131,6 @@ load_library(isc_mem_t *mctx, const char *filename, const char *instname,
|
|||||||
CHECK(ISC_R_FAILURE);
|
CHECK(ISC_R_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Clear dlerror */
|
|
||||||
(void)lt_dlerror();
|
|
||||||
|
|
||||||
CHECK(load_symbol(handle, filename, "dyndb_version",
|
CHECK(load_symbol(handle, filename, "dyndb_version",
|
||||||
(void **)&version_func));
|
(void **)&version_func));
|
||||||
|
|
||||||
|
@@ -98,14 +98,6 @@ load_symbol(void *handle, const char *modpath, const char *symbol_name,
|
|||||||
REQUIRE(handle != NULL);
|
REQUIRE(handle != NULL);
|
||||||
REQUIRE(symbolp != NULL && *symbolp == 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);
|
symbol = lt_dlsym(handle, symbol_name);
|
||||||
if (symbol == NULL) {
|
if (symbol == NULL) {
|
||||||
const char *errmsg = lt_dlerror();
|
const char *errmsg = lt_dlerror();
|
||||||
|
Reference in New Issue
Block a user