summaryrefslogtreecommitdiff
blob: 9aa899b3e070813337ac2d9540e1d047e07c6150 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
--- udev-104-orig/udev_device.c	2007-01-15 14:56:11.000000000 +0100
+++ udev-git/udev_device.c	2007-01-24 17:59:07.000000000 +0100
@@ -122,16 +122,17 @@
 		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);
 		}
 	}