summaryrefslogtreecommitdiff
path: root/udev_device.c
diff options
context:
space:
mode:
Diffstat (limited to 'udev_device.c')
-rw-r--r--udev_device.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/udev_device.c b/udev_device.c
index bc0b33077e..1eebd61cc5 100644
--- a/udev_device.c
+++ b/udev_device.c
@@ -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);
}
}