start_stop_daemon: NOMMU fixes, round 2 by Alex Landau <landau_alex@yahoo.com>
[oweals/busybox.git] / networking / arping.c
index 7a9fbc2f447a0907fc422644cfe0736947aaef80..8e457b13aa2eb86e85249743e6bba9a1763fe1cc 100644 (file)
@@ -273,14 +273,11 @@ int arping_main(int argc, char **argv)
 
                memset(&ifr, 0, sizeof(ifr));
                strncpy(ifr.ifr_name, device, IFNAMSIZ - 1);
-               if (ioctl(sock, SIOCGIFINDEX, &ifr) < 0) {
-                       bb_error_msg_and_die("interface %s not found", device);
-               }
+               ioctl_or_perror_and_die(sock, SIOCGIFINDEX, &ifr, "interface %s not found", device);
                ifindex = ifr.ifr_ifindex;
 
-               if (ioctl(sock, SIOCGIFFLAGS, (char *) &ifr)) {
-                       bb_error_msg_and_die("SIOCGIFFLAGS");
-               }
+               xioctl(sock, SIOCGIFFLAGS, (char *) &ifr);
+
                if (!(ifr.ifr_flags & IFF_UP)) {
                        bb_error_msg_and_die("interface %s is down", device);
                }