]> err.no Git - systemd/commitdiff
fix retry-loop in netif-rename code
authorMatthias Schwarzott <zzam@gentoo.org>
Tue, 23 Jan 2007 19:01:30 +0000 (20:01 +0100)
committerKay Sievers <kay.sievers@vrfy.org>
Tue, 23 Jan 2007 19:01:30 +0000 (20:01 +0100)
udev_device.c

index bc0b33077e274eedcaf913c11d0d3b27e0112f0d..1eebd61cc56fc56c7c3c6dbeede8edc7b274f3e2 100644 (file)
@@ -122,16 +122,17 @@ static int rename_netif(struct udevice *udev)
                strlcpy(ifr.ifr_newname, udev->name, IFNAMSIZ);
                loop = 30 * 20;
                while (loop--) {
-                       retval = ioctl(sk, SIOCSIFNAME, &ifr);  
-                       if (retval != 0) {
-                               if (errno != EEXIST) {
-                                       err("error changing net interface name %s to %s: %s",
-                                           ifr.ifr_name, ifr.ifr_newname, strerror(errno));
-                                       break;
-                               }
-                               dbg("wait for netif '%s' to become free, loop=%i", udev->name, (30 * 20) - loop);
-                               usleep(1000 * 1000 / 20);
+                       retval = ioctl(sk, SIOCSIFNAME, &ifr);
+                       if (retval == 0)
+                               break;
+
+                       if (errno != EEXIST) {
+                               err("error changing net interface name %s to %s: %s",
+                                   ifr.ifr_name, ifr.ifr_newname, strerror(errno));
+                               break;
                        }
+                       dbg("wait for netif '%s' to become free, loop=%i", udev->name, (30 * 20) - loop);
+                       usleep(1000 * 1000 / 20);
                }
        }