Skip to content

Commit

Permalink
preloadNSS: warn if unable to open nss backend
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur Gautier <[email protected]>
  • Loading branch information
baloo committed Oct 14, 2021
1 parent f0fd6d1 commit 41a6044
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/libmain/shared.cc
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ static void preloadNSS() {
load its lookup libraries in the parent before any child gets a chance to. */
std::call_once(dns_resolve_flag, []() {
#ifndef STATIC
dlopen (LIBNSS_DNS_SO, RTLD_NOW);
if (dlopen (LIBNSS_DNS_SO, RTLD_NOW) == NULL) {
printMsg(Verbosity::lvlWarn, fmt("Unable to load nss_dns backend"));
}
__nss_configure_lookup ("hosts", "dns");
#endif
});
Expand Down

0 comments on commit 41a6044

Please sign in to comment.