diff options
author | Matthias Schwarzott <zzam@gentoo.org> | 2007-01-23 20:01:30 +0100 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2007-01-23 20:01:30 +0100 |
commit | ca714ef70e549aad486a62f4d6ef849572e3a7f1 (patch) | |
tree | aeed8cc505682da2ee01ee27dcc1180ad499e262 /udev_device.c | |
parent | e0c0807ab32fde7f55776e0a300016bad922e636 (diff) |
fix retry-loop in netif-rename code
Diffstat (limited to 'udev_device.c')
-rw-r--r-- | udev_device.c | 19 |
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); } } |