summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Shmidt2015-03-18 19:26:30 -0500
committerGerrit Code Review2015-03-18 19:26:30 -0500
commitd9a65a65610cb675b092cd343f04e2176a57c26f (patch)
treecf2f9e0a0d792f8e4dde26ac4ce20613a72dd668 /libnetutils
parent4e0a252372052f194764c3c0a511e17d22549e6c (diff)
parentc855bddc67f218af09c742527f423075c0017aa8 (diff)
downloadplatform-system-core-d9a65a65610cb675b092cd343f04e2176a57c26f.tar.gz
platform-system-core-d9a65a65610cb675b092cd343f04e2176a57c26f.tar.xz
platform-system-core-d9a65a65610cb675b092cd343f04e2176a57c26f.zip
Merge "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 0f7c384c5..70e37c676 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}