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 15, 2021
1 parent 85717ef commit ca8989d
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 @@ -125,7 +125,9 @@ static void preloadNSS() {
load its lookup libraries in the parent before any child gets a chance to. */
std::call_once(dns_resolve_flag, []() {
#ifdef __GLIBC__
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 ca8989d

Please sign in to comment.