projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
setjmp: optimize longjmp prologues
[musl]
/
src
/
network
/
if_nametoindex.c
diff --git
a/src/network/if_nametoindex.c
b/src/network/if_nametoindex.c
index
cb6ec05
..
331413c
100644
(file)
--- a/
src/network/if_nametoindex.c
+++ b/
src/network/if_nametoindex.c
@@
-10,7
+10,7
@@
unsigned if_nametoindex(const char *name)
struct ifreq ifr;
int fd, r;
struct ifreq ifr;
int fd, r;
- if ((fd = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0)) < 0) return
-1
;
+ if ((fd = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0)) < 0) return
0
;
strncpy(ifr.ifr_name, name, sizeof ifr.ifr_name);
r = ioctl(fd, SIOCGIFINDEX, &ifr);
__syscall(SYS_close, fd);
strncpy(ifr.ifr_name, name, sizeof ifr.ifr_name);
r = ioctl(fd, SIOCGIFINDEX, &ifr);
__syscall(SYS_close, fd);