From: Roy Marples Date: Sun, 17 Feb 2013 16:12:54 +0000 (+0000) Subject: Fix compile on FreeBSD X-Git-Tag: v5.99.6~66 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3024ea4c154eb6cd48ee7dcf6a3986e7f1cd2009;p=thirdparty%2Fdhcpcd.git Fix compile on FreeBSD --- diff --git a/bpf.c b/bpf.c index ab7bdf54..835c353a 100644 --- a/bpf.c +++ b/bpf.c @@ -67,7 +67,9 @@ ipv4_opensocket(struct interface *ifp, int protocol) char *device; int n = 0; - device = xmalloc(sizeof(char) * PATH_MAX); + device = malloc(sizeof(char) * PATH_MAX); + if (device == NULL) + return -1; do { snprintf(device, PATH_MAX, "/dev/bpf%d", n++); fd = open(device, O_RDWR | O_NONBLOCK); diff --git a/dhcp.c b/dhcp.c index b845ed81..8ec51400 100644 --- a/dhcp.c +++ b/dhcp.c @@ -25,8 +25,7 @@ * SUCH DAMAGE. */ -#include -#include +#include #include #ifdef __linux__ @@ -34,6 +33,9 @@ # include #endif +#include +#include + #include #include #include diff --git a/ipv4.c b/ipv4.c index 10b79e7a..f9e43d14 100644 --- a/ipv4.c +++ b/ipv4.c @@ -25,6 +25,9 @@ * SUCH DAMAGE. */ +#include +#include + #include #include #include