chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e44da74
)
networkd: tuntap - return correct error when /dev/net/tun cannot be opened
author
Tom Gundersen
<teg@jklm.no>
Sat, 6 Sep 2014 20:06:58 +0000
(22:06 +0200)
committer
Tom Gundersen
<teg@jklm.no>
Mon, 8 Sep 2014 13:07:51 +0000
(15:07 +0200)
src/network/networkd-netdev-tuntap.c
patch
|
blob
|
history
diff --git
a/src/network/networkd-netdev-tuntap.c
b/src/network/networkd-netdev-tuntap.c
index eef8747210431c8318dd975f776cadee0e52235c..eaf5df49718f14385372cf7b88f74ec73d72e390 100644
(file)
--- 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) {