am c92420b2: am d9a65a65: Merge "Improving the time to wait for assigning IP address"
* commit 'c92420b23b3006ed2e1ece6020dc9d6daa7bf336':
Improving the time to wait for assigning IP address
diff --git a/libnetutils/dhcp_utils.c b/libnetutils/dhcp_utils.c
index 851d565..c6b9fe4 100644
--- a/libnetutils/dhcp_utils.c
+++ b/libnetutils/dhcp_utils.c
@@ -72,14 +72,16 @@
maxnaps = 1;
}
- while (maxnaps-- > 0) {
- usleep(NAP_TIME * 1000);
+ while (maxnaps-- >= 0) {
if (property_get(name, value, NULL)) {
if (desired_value == NULL ||
strcmp(value, desired_value) == 0) {
return 0;
}
}
+ if (maxnaps >= 0) {
+ usleep(NAP_TIME * 1000);
+ }
}
return -1; /* failure */
}