aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBala Krishna Bhamidipati <c_bbhami@qti.qualcomm.com>2016-06-23 17:12:50 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2016-06-23 04:45:38 -0700
commita32afeb7d0eb32acdea60a7312ce856b8695c757 (patch)
tree33cac64d71edfff3429691403f30d5bddf93bf53
parent38b8dc8a1c61bd268f0f4eea3f1fb0169583352b (diff)
downloadandroid_external_wpa_supplicant_8-a32afeb7d0eb32acdea60a7312ce856b8695c757.tar.gz
android_external_wpa_supplicant_8-a32afeb7d0eb32acdea60a7312ce856b8695c757.tar.bz2
android_external_wpa_supplicant_8-a32afeb7d0eb32acdea60a7312ce856b8695c757.zip
eap_proxy: postpone qmi init until demonize
Parent thread exits when daemonize. This will cause child threads to die and eap_proxy_post_init is not executed To fix this, child thread should be created after demonize Change-Id: Ibd9e3dc79cb1a7650b3adc55afdc95818a2e011b CRs-Fixed: 1032710
-rw-r--r--src/eap_peer/eap_proxy_qmi.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/eap_peer/eap_proxy_qmi.c b/src/eap_peer/eap_proxy_qmi.c
index 49ecc4df..6198baa0 100644
--- a/src/eap_peer/eap_proxy_qmi.c
+++ b/src/eap_peer/eap_proxy_qmi.c
@@ -716,6 +716,20 @@ int eap_auth_end_eap_session(qmi_client_type qmi_auth_svc_client_ptr)
return 0;
}
+static void eap_proxy_schedule_thread(void *eloop_ctx, void *timeout_ctx)
+{
+ struct eap_proxy_sm *eap_proxy = eloop_ctx;
+ pthread_attr_t attr;
+ int ret = -1;
+
+ pthread_attr_init(&attr);
+ pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+ ret = pthread_create(&eap_proxy->thread_id, &attr, eap_proxy_post_init, eap_proxy);
+ if(ret < 0)
+ wpa_printf(MSG_ERROR, "eap_proxy: starting thread is failed %d\n", ret);
+}
+
+
struct eap_proxy_sm *
eap_proxy_init(void *eapol_ctx, struct eapol_callbacks *eapol_cb,
void *msg_ctx)
@@ -724,8 +738,6 @@ eap_proxy_init(void *eapol_ctx, struct eapol_callbacks *eapol_cb,
int qmiRetCode;
struct eap_proxy_sm *eap_proxy;
qmi_idl_service_object_type qmi_client_service_obj;
- pthread_attr_t attr;
- int ret = -1;
eap_proxy = os_malloc(sizeof(struct eap_proxy_sm));
if (NULL == eap_proxy) {
@@ -751,11 +763,7 @@ eap_proxy_init(void *eapol_ctx, struct eapol_callbacks *eapol_cb,
* parent process that created the qmi client context.
*/
- pthread_attr_init(&attr);
- pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
- ret = pthread_create(&eap_proxy->thread_id, &attr, eap_proxy_post_init, eap_proxy);
- if(ret < 0)
- wpa_printf(MSG_ERROR, "eap_proxy: starting thread is failed %d\n", ret);
+ eloop_register_timeout(0, 0, eap_proxy_schedule_thread, eap_proxy, NULL);
return eap_proxy;
}