commit a7eeb2a768dc585aebe5150251e1b2b406e61ce2
parent e9ff73ec2b6707d6e068d6ac77c056f152e901cd
Author: sin <sin@2f30.org>
Date: Fri, 8 Apr 2016 10:11:34 +0100
moar style fix
Diffstat:
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/stun.c b/stun.c
@@ -256,8 +256,7 @@ opendev(char *dev)
struct ifreq ifr;
int fd, s;
- fd = open("/dev/net/tun", O_RDWR);
- if (fd < 0)
+ if ((fd = open("/dev/net/tun", O_RDWR)) < 0)
logerr("failed to open %s", "/dev/net/tun");
memset(&ifr, 0, sizeof(ifr));
@@ -268,8 +267,7 @@ opendev(char *dev)
logerr("failed to set TUNSETIFF on %s", dev);
/* dummy socket so we can manipulate the params */
- s = socket(AF_INET, SOCK_STREAM, 0);
- if (s < 0)
+ if ((s = socket(AF_INET, SOCK_STREAM, 0)) < 0)
logerr("failed to create socket");
if (devtype == TUNDEV)
ifr.ifr_mtu = MAXPAYLOADLEN;
@@ -300,8 +298,7 @@ opendev(char *dev)
struct tuninfo ti;
int fd;
- fd = open(dev, O_RDWR);
- if (fd < 0)
+ if ((fd = open(dev, O_RDWR)) < 0)
logerr("failed to open %s", dev);
if (ioctl(fd, TUNGIFINFO, &ti) < 0)
logerr("failed to set TUNGIFINFO on %s", dev);