Skip to content

Commit 87deac6

Browse files
committed
rand: only try and use freeifaddrs if available
1 parent de4d3ba commit 87deac6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/randomenv.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#include <sys/utsname.h>
3939
#include <unistd.h>
4040
#endif
41-
#if HAVE_DECL_GETIFADDRS
41+
#if HAVE_DECL_GETIFADDRS && HAVE_DECL_FREEIFADDRS
4242
#include <ifaddrs.h>
4343
#endif
4444
#if HAVE_SYSCTL
@@ -361,7 +361,7 @@ void RandAddStaticEnv(CSHA512& hasher)
361361
hasher.Write((const unsigned char*)hname, strnlen(hname, 256));
362362
}
363363

364-
#if HAVE_DECL_GETIFADDRS
364+
#if HAVE_DECL_GETIFADDRS && HAVE_DECL_FREEIFADDRS
365365
// Network interfaces
366366
struct ifaddrs *ifad = NULL;
367367
getifaddrs(&ifad);

0 commit comments

Comments
 (0)