1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2026-01-01 01:41:18 +01:00

guard pre-err() warn() calls

This commit is contained in:
Ludwig Ortmann 2014-01-29 19:13:49 +01:00
parent 176f379c7a
commit f0340b90a2

View File

@ -261,6 +261,7 @@ int tap_init(char *name)
strncpy(ifr.ifr_name, name, IFNAMSIZ);
if (ioctl(_native_tap_fd, TUNSETIFF, (void *)&ifr) == -1) {
_native_in_syscall++;
warn("ioctl TUNSETIFF");
warnx("probably the tap interface (%s) does not exist or is already in use", name);
exit(EXIT_FAILURE);
@ -274,6 +275,7 @@ int tap_init(char *name)
memset (&ifr, 0, sizeof (ifr));
snprintf (ifr.ifr_name, sizeof (ifr.ifr_name), "%s", name);
if (ioctl(_native_tap_fd, SIOCGIFHWADDR, &ifr) == -1) {
_native_in_syscall++;
warn("ioctl SIOCGIFHWADDR");
if (close(_native_tap_fd) == -1) {
warn("close");