am d9a65a65: Merge "Improving the time to wait for assigning IP address"

* commit 'd9a65a65610cb675b092cd343f04e2176a57c26f':
  Improving the time to wait for assigning IP address
This commit is contained in:
Dmitry Shmidt 2015-03-19 00:37:51 +00:00 committed by Android Git Automerger
commit c92420b23b

View file

@ -72,14 +72,16 @@ static int wait_for_property(const char *name, const char *desired_value, int ma
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 */
}