From 87deac66aa747481e6f34fc80599e1e490de3ea0 Mon Sep 17 00:00:00 2001 From: fanquake Date: Sat, 20 Mar 2021 17:57:43 +0800 Subject: [PATCH] rand: only try and use freeifaddrs if available --- src/randomenv.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/randomenv.cpp b/src/randomenv.cpp index 9248db1539c..fa2a3a0607f 100644 --- a/src/randomenv.cpp +++ b/src/randomenv.cpp @@ -38,7 +38,7 @@ #include #include #endif -#if HAVE_DECL_GETIFADDRS +#if HAVE_DECL_GETIFADDRS && HAVE_DECL_FREEIFADDRS #include #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);