aboutsummaryrefslogtreecommitdiff
path: root/src/randomenv.cpp
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2021-03-20 17:57:43 +0800
committerfanquake <fanquake@gmail.com>2021-03-29 11:08:29 +0800
commit87deac66aa747481e6f34fc80599e1e490de3ea0 (patch)
tree487035e37564eb28b869ca6db43eea0c86132123 /src/randomenv.cpp
parentde4d3ba43705ea313f92f17295005c371a8d0bd0 (diff)
downloadbitcoin-87deac66aa747481e6f34fc80599e1e490de3ea0.tar.xz
rand: only try and use freeifaddrs if available
Diffstat (limited to 'src/randomenv.cpp')
-rw-r--r--src/randomenv.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/randomenv.cpp b/src/randomenv.cpp
index 9248db1539..fa2a3a0607 100644
--- a/src/randomenv.cpp
+++ b/src/randomenv.cpp
@@ -38,7 +38,7 @@
#include <sys/utsname.h>
#include <unistd.h>
#endif
-#if HAVE_DECL_GETIFADDRS
+#if HAVE_DECL_GETIFADDRS && HAVE_DECL_FREEIFADDRS
#include <ifaddrs.h>
#endif
#if HAVE_SYSCTL
@@ -361,7 +361,7 @@ void RandAddStaticEnv(CSHA512& hasher)
hasher.Write((const unsigned char*)hname, strnlen(hname, 256));
}
-#if HAVE_DECL_GETIFADDRS
+#if HAVE_DECL_GETIFADDRS && HAVE_DECL_FREEIFADDRS
// Network interfaces
struct ifaddrs *ifad = NULL;
getifaddrs(&ifad);