]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix compile on Bitrig
authorRoy Marples <roy@marples.name>
Sat, 12 Sep 2015 13:14:27 +0000 (13:14 +0000)
committerRoy Marples <roy@marples.name>
Sat, 12 Sep 2015 13:14:27 +0000 (13:14 +0000)
configure
if.c

index 0c8513e085275a06d6165ac20f97cd36c648358b..a72db2aee8ce64b839df92bb5c06df0b72ebffb2 100755 (executable)
--- a/configure
+++ b/configure
@@ -336,6 +336,8 @@ CFLAGS+=    -Wpointer-sign -Wmissing-noreturn
 EOF
        case "$OS" in
        mirbsd*|openbsd*);; # OpenBSD has many redundant decs in system headers
+       bitrig*)        echo "CFLAGS+=  -Wredundant-decls" >>$CONFIG_MK
+                       ;; # Bitrig spouts many conversion errors with htons
        *)              echo "CFLAGS+=  -Wredundant-decls" >>$CONFIG_MK
                        echo "CFLAGS+=  -Wconversion" >>$CONFIG_MK
                        ;;
diff --git a/if.c b/if.c
index 6c450b99ee8980763bad5a119803caebf91f2e64..0df8ce3a3480b9c8fcab06651af242b96b9363ac 100644 (file)
--- a/if.c
+++ b/if.c
@@ -520,7 +520,7 @@ if_discover(struct dhcpcd_ctx *ctx, int argc, char * const *argv)
                memset(&ifr, 0, sizeof(ifr));
                strlcpy(ifr.ifr_name, ifp->name, sizeof(ifr.ifr_name));
                if (ioctl(ctx->pf_inet_fd, SIOCGIFPRIORITY, &ifr) == 0)
-                       ifp->metric = ifr.ifr_metric;
+                       ifp->metric = (unsigned int)ifr.ifr_metric;
 #else
                /* We reserve the 100 range for virtual interfaces, if and when
                 * we can work them out. */
@@ -675,11 +675,11 @@ xsocket(int domain, int type, int protocol, int flags)
 
        if ((s = socket(domain, type, protocol)) == -1)
                return -1;
-       if ((flags & O_CLOEXEC) && (xflags = fcntl(s, F_GETFD, 0)) == -1 ||
-           fcntl(s, F_SETFD, xflags | FD_CLOEXEC) == -1)
+       if ((flags & O_CLOEXEC) && ((xflags = fcntl(s, F_GETFD, 0)) == -1 ||
+           fcntl(s, F_SETFD, xflags | FD_CLOEXEC) == -1))
                goto out;
-       if ((flags & O_NONBLOCK) && (xflags = fcntl(s, F_GETFL, 0)) == -1 ||
-           fcntl(s, F_SETFL, xflags | O_NONBLOCK) == -1)
+       if ((flags & O_NONBLOCK) && ((xflags = fcntl(s, F_GETFL, 0)) == -1 ||
+           fcntl(s, F_SETFL, xflags | O_NONBLOCK) == -1))
                goto out;
        return s;
 out: