From 9b802ff7f2d888d8abe8e6c2f83b8d0875e7cf2d Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Wed, 16 Jun 2021 18:17:11 +0200 Subject: [PATCH] nm-daemon-helper: fix build with musl libc NSS is not available in musl libc: ./src/nm-daemon-helper/nm-daemon-helper.c:9:10: fatal error: nss.h: No such file or directory 9 | #include | ^~~~~~~ --- src/nm-daemon-helper/nm-daemon-helper.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/nm-daemon-helper/nm-daemon-helper.c b/src/nm-daemon-helper/nm-daemon-helper.c index 3a95c6829f..21a71e3c4a 100644 --- a/src/nm-daemon-helper/nm-daemon-helper.c +++ b/src/nm-daemon-helper/nm-daemon-helper.c @@ -6,7 +6,9 @@ #include #include #include +#if defined(__GLIBC__) #include +#endif #include "libnm-std-aux/nm-std-aux.h" @@ -68,7 +70,9 @@ cmd_resolve_address(void) return RETURN_INVALID_ARGS; memset(&sockaddr, 0, sizeof(sockaddr)); +#if defined(__GLIBC__) __nss_configure_lookup("hosts", "dns"); +#endif if (inet_pton(AF_INET, address, &sockaddr.in.sin_addr) == 1) { sockaddr.in.sin_family = AF_INET;