mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
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 <arpa/inet.h> (the way Linux does it), it is not mandatory, and conforming applications are required to get it through <netinet/in.h>. * src/util/virportallocator.c: Include header for struct sockaddr_in. * tests/virportallocatortest.c: Likewise.
This commit is contained in:
parent
7d31dd6494
commit
f403bdc189
@ -23,6 +23,7 @@
|
||||
|
||||
#include <sys/socket.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
#include "viralloc.h"
|
||||
#include "virbitmap.h"
|
||||
|
@ -25,6 +25,7 @@
|
||||
# include <sys/socket.h>
|
||||
# include <errno.h>
|
||||
# include <arpa/inet.h>
|
||||
# include <netinet/in.h>
|
||||
|
||||
int bind(int sockfd ATTRIBUTE_UNUSED,
|
||||
const struct sockaddr *addr,
|
||||
|
Loading…
Reference in New Issue
Block a user