summaryrefslogtreecommitdiffstats
path: root/wifi
diff options
context:
space:
mode:
authorIrfan Sheriff <isheriff@google.com>2012-10-10 15:41:13 -0700
committerIrfan Sheriff <isheriff@google.com>2012-10-11 11:03:12 -0700
commit897f6dd64224d22c22c8f7a497331bf5bc335e4c (patch)
tree595c33c73e5902ede9fecea35ccafd0202020926 /wifi
parent738207def5f691d605ae33d041116829a74513a9 (diff)
downloadhardware_libhardware_legacy-897f6dd64224d22c22c8f7a497331bf5bc335e4c.zip
hardware_libhardware_legacy-897f6dd64224d22c22c8f7a497331bf5bc335e4c.tar.gz
hardware_libhardware_legacy-897f6dd64224d22c22c8f7a497331bf5bc335e4c.tar.bz2
Fix native crash
Bug: 6404766 Change-Id: I8d2199fe2f4d48840a237b1ec2d085fe40c06517
Diffstat (limited to 'wifi')
-rw-r--r--wifi/wifi.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/wifi/wifi.c b/wifi/wifi.c
index cd9bf65..f669693 100644
--- a/wifi/wifi.c
+++ b/wifi/wifi.c
@@ -727,10 +727,10 @@ int wifi_ctrl_recv(int index, char *reply, size_t *reply_len)
}
if (rfds[0].revents & POLLIN) {
return wpa_ctrl_recv(monitor_conn[index], reply, reply_len);
- } else {
- return -2;
+ } else if (rfds[1].revents & POLLIN) {
+ wifi_close_sockets(index);
}
- return 0;
+ return -2;
}
int wifi_wait_on_socket(int index, char *buf, size_t buflen)
@@ -837,9 +837,9 @@ void wifi_close_supplicant_connection(const char *ifname)
* STA connection does not need it since supplicant gets shutdown
*/
TEMP_FAILURE_RETRY(write(exit_sockets[SECONDARY][0], "T", 1));
- wifi_close_sockets(SECONDARY);
- //closing p2p connection does not need a wait on
- //supplicant stop
+ /* p2p sockets are closed after the monitor thread
+ * receives the terminate on the exit socket
+ */
return;
}