summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Shmidt2015-03-18 19:43:49 -0500
committerAndroid Git Automerger2015-03-18 19:43:49 -0500
commit91dbb7eb6aaf777c47d657518777964742f9491a (patch)
tree3fd45508a06f1fd53d6d13e5b2517cef837d33cb /libnetutils
parent2fe4f9a68df24c0ec1ad1e22223197aa35218990 (diff)
parentc92420b23b3006ed2e1ece6020dc9d6daa7bf336 (diff)
downloadplatform-system-core-91dbb7eb6aaf777c47d657518777964742f9491a.tar.gz
platform-system-core-91dbb7eb6aaf777c47d657518777964742f9491a.tar.xz
platform-system-core-91dbb7eb6aaf777c47d657518777964742f9491a.zip
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
Diffstat (limited to 'libnetutils')
-rw-r--r--libnetutils/dhcp_utils.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libnetutils/dhcp_utils.c b/libnetutils/dhcp_utils.c
index 851d56597..c6b9fe491 100644
--- a/libnetutils/dhcp_utils.c
+++ b/libnetutils/dhcp_utils.c
@@ -72,14 +72,16 @@ static int wait_for_property(const char *name, const char *desired_value, int ma
72 maxnaps = 1; 72 maxnaps = 1;
73 } 73 }
74 74
75 while (maxnaps-- > 0) { 75 while (maxnaps-- >= 0) {
76 usleep(NAP_TIME * 1000);
77 if (property_get(name, value, NULL)) { 76 if (property_get(name, value, NULL)) {
78 if (desired_value == NULL || 77 if (desired_value == NULL ||
79 strcmp(value, desired_value) == 0) { 78 strcmp(value, desired_value) == 0) {
80 return 0; 79 return 0;
81 } 80 }
82 } 81 }
82 if (maxnaps >= 0) {
83 usleep(NAP_TIME * 1000);
84 }
83 } 85 }
84 return -1; /* failure */ 86 return -1; /* failure */
85} 87}