summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-06-25 19:01:16 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-06-26 07:26:19 +0200
commitad16158c10dfc3258831a9ff2f1a988214f51653 (patch)
treeccffa16f9dba0fbd7dad29ee9db9e0a495639fb0 /src/network
parentcrypt-util: Translate libcryptsetup log level instead of using log_debug() (diff)
downloadsystemd-ad16158c10dfc3258831a9ff2f1a988214f51653.tar.xz
systemd-ad16158c10dfc3258831a9ff2f1a988214f51653.zip
netdev: do not assign unused values
Diffstat (limited to 'src/network')
-rw-r--r--src/network/netdev/tuntap.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/network/netdev/tuntap.c b/src/network/netdev/tuntap.c
index 21fb7ab067..47c56cfd70 100644
--- a/src/network/netdev/tuntap.c
+++ b/src/network/netdev/tuntap.c
@@ -64,8 +64,7 @@ static int netdev_tuntap_add(NetDev *netdev, struct ifreq *ifr) {
if (fd < 0)
return log_netdev_error_errno(netdev, -errno, "Failed to open tun dev: %m");
- r = ioctl(fd, TUNSETIFF, ifr);
- if (r < 0)
+ if (ioctl(fd, TUNSETIFF, ifr) < 0)
return log_netdev_error_errno(netdev, -errno, "TUNSETIFF failed on tun dev: %m");
if (netdev->kind == NETDEV_KIND_TAP)
@@ -83,8 +82,7 @@ static int netdev_tuntap_add(NetDev *netdev, struct ifreq *ifr) {
if (r < 0)
return log_netdev_error_errno(netdev, r, "Cannot resolve user name %s: %m", t->user_name);
- r = ioctl(fd, TUNSETOWNER, uid);
- if (r < 0)
+ if (ioctl(fd, TUNSETOWNER, uid) < 0)
return log_netdev_error_errno(netdev, -errno, "TUNSETOWNER failed on tun dev: %m");
}
@@ -96,14 +94,12 @@ static int netdev_tuntap_add(NetDev *netdev, struct ifreq *ifr) {
if (r < 0)
return log_netdev_error_errno(netdev, r, "Cannot resolve group name %s: %m", t->group_name);
- r = ioctl(fd, TUNSETGROUP, gid);
- if (r < 0)
+ if (ioctl(fd, TUNSETGROUP, gid) < 0)
return log_netdev_error_errno(netdev, -errno, "TUNSETGROUP failed on tun dev: %m");
}
- r = ioctl(fd, TUNSETPERSIST, 1);
- if (r < 0)
+ if (ioctl(fd, TUNSETPERSIST, 1) < 0)
return log_netdev_error_errno(netdev, -errno, "TUNSETPERSIST failed on tun dev: %m");
return 0;