From f403bdc1891d5f7e20f268a592b2fa9fb1e2566f Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Thu, 17 Jan 2013 16:29:38 -0700 Subject: [PATCH] build: fix build on BSD A build on FreeBSD failed with: util/virportallocator.c:108: error: storage size of 'addr' isn't known util/virportallocator.c:123: error: 'INADDR_ANY' undeclared (first use in this function) It turns out that while POSIX allows sockaddr_in to leak in through (the way Linux does it), it is not mandatory, and conforming applications are required to get it through . * src/util/virportallocator.c: Include header for struct sockaddr_in. * tests/virportallocatortest.c: Likewise. --- src/util/virportallocator.c | 1 + tests/virportallocatortest.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/util/virportallocator.c b/src/util/virportallocator.c index 35f2157a41..590bb570f6 100644 --- a/src/util/virportallocator.c +++ b/src/util/virportallocator.c @@ -23,6 +23,7 @@ #include #include +#include #include "viralloc.h" #include "virbitmap.h" diff --git a/tests/virportallocatortest.c b/tests/virportallocatortest.c index 3f6edcc394..9931e11638 100644 --- a/tests/virportallocatortest.c +++ b/tests/virportallocatortest.c @@ -25,6 +25,7 @@ # include # include # include +# include int bind(int sockfd ATTRIBUTE_UNUSED, const struct sockaddr *addr,