* Getting rid of goto usage throughout code.
[monky] / src / openbsd.c
index 2655992..1a87e87 100644 (file)
@@ -628,7 +628,8 @@ void update_wifi_stats()
                bzero(&ifmr, sizeof(ifmr));
                strlcpy(ifmr.ifm_name, ifa->ifa_name, IFNAMSIZ);
                if (ioctl(s, SIOCGIFMEDIA, (caddr_t) &ifmr) < 0) {
-                       goto cleanup;
+                       close(s);
+                       return;
                }
 
                /* We can monitor only wireless interfaces