summaryrefslogtreecommitdiffstats
path: root/if.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2015-09-12 13:14:27 +0000
committerRoy Marples <roy@marples.name>2015-09-12 13:14:27 +0000
commit5cd73faeab6fb6533b2eb0dfdabf996e9d2da348 (patch)
tree2c9e9c85796e9b3b3793537de9b93e39486f39c4 /if.c
parentf800a7692af9446e039e935f44d6c0f48ede6e90 (diff)
downloaddhcpcd-5cd73faeab6fb6533b2eb0dfdabf996e9d2da348.tar.xz
Fix compile on Bitrig
Diffstat (limited to 'if.c')
-rw-r--r--if.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/if.c b/if.c
index 6c450b99..0df8ce3a 100644
--- 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: