summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
Diffstat (limited to 'src/network')
-rw-r--r--src/network/networkd-netdev-tuntap.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/network/networkd-netdev-tuntap.c b/src/network/networkd-netdev-tuntap.c
index eef8747210..eaf5df4971 100644
--- a/src/network/networkd-netdev-tuntap.c
+++ b/src/network/networkd-netdev-tuntap.c
@@ -63,17 +63,15 @@ static int netdev_tuntap_add(NetDev *netdev, struct ifreq *ifr) {
const char *group;
uid_t uid;
gid_t gid;
- int r = 0;
+ int r;
assert(netdev);
assert(ifr);
fd = open(TUN_DEV, O_RDWR);
if (fd < 0) {
- log_error_netdev(netdev,
- "Failed to open tun dev: %s",
- strerror(-r));
- return r;
+ log_error_netdev(netdev, "Failed to open tun dev: %m");
+ return -errno;
}
r = ioctl(fd, TUNSETIFF, ifr);
@@ -139,7 +137,7 @@ static int netdev_tuntap_add(NetDev *netdev, struct ifreq *ifr) {
return r;
}
- return r;
+ return 0;
}
static int netdev_create_tuntap(NetDev *netdev) {