summaryrefslogtreecommitdiffstats
path: root/wifi/wifi.c
diff options
context:
space:
mode:
Diffstat (limited to 'wifi/wifi.c')
-rw-r--r--wifi/wifi.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/wifi/wifi.c b/wifi/wifi.c
index 8783df2..3bcc8be 100644
--- a/wifi/wifi.c
+++ b/wifi/wifi.c
@@ -471,12 +471,16 @@ int wifi_start_supplicant(int p2p_supported)
pi = __system_property_find(supplicant_prop_name);
}
if (pi != NULL) {
- __system_property_read(pi, NULL, supp_status);
- if (strcmp(supp_status, "running") == 0) {
- return 0;
- } else if (__system_property_serial(pi) != serial &&
- strcmp(supp_status, "stopped") == 0) {
- return -1;
+ /*
+ * property serial updated means that init process is scheduled
+ * after we sched_yield, further property status checking is based on this */
+ if (__system_property_serial(pi) != serial) {
+ __system_property_read(pi, NULL, supp_status);
+ if (strcmp(supp_status, "running") == 0) {
+ return 0;
+ } else if (strcmp(supp_status, "stopped") == 0) {
+ return -1;
+ }
}
}
#else