[Bugfix][T8TSK-255][T8TSK-299]MNLD program crash causing crazy a large number of printing issues with "unknown fd"
Only Configure:No
Affected branch:master
Affected module:gnss
Is it affected on both ZXIC and MTK:only MTK
Self-test:Yes
Doc Update:NO
Change-Id: Ie89c562cf6f140333b5e1f3d0147d0f3ff04a724
diff --git a/src/connectivity/gps/2.0/gps_hal/src/gpshal_worker.c b/src/connectivity/gps/2.0/gps_hal/src/gpshal_worker.c
old mode 100644
new mode 100755
index bd2b62b..95fccb2
--- a/src/connectivity/gps/2.0/gps_hal/src/gpshal_worker.c
+++ b/src/connectivity/gps/2.0/gps_hal/src/gpshal_worker.c
@@ -119,6 +119,12 @@
}
void gpshal_mnl_retry_routine(void) {
+ if (g_gpshal_ctx.fd_mnl2hal_basic != -1){
+ mnldinf_epoll_del_fd(g_gpshal_ctx.fd_worker_epoll, g_gpshal_ctx.fd_mnl2hal_basic);
+ }
+ if (g_gpshal_ctx.fd_mnl2hal_ext != -1){
+ mnldinf_epoll_del_fd(g_gpshal_ctx.fd_worker_epoll, g_gpshal_ctx.fd_mnl2hal_ext);
+ }
gpshal_close(g_gpshal_ctx.fd_mnl2hal_basic);
gpshal_close(g_gpshal_ctx.fd_mnl2hal_ext);
@@ -126,6 +132,7 @@
if (-1 == g_gpshal_ctx.fd_mnl2hal_basic) { // error
LOGW("fd_mnl2hal_basic recreate fail, will retry after %d ms", GPSHAL_MNL_RETRY_INTERVAL);
mnldinf_start_timer(g_gpshal_ctx.mnl_retry_timer, GPSHAL_MNL_RETRY_INTERVAL);
+ return;
} else {
if (mnldinf_epoll_add_fd(
g_gpshal_ctx.fd_worker_epoll,
@@ -139,6 +146,7 @@
if (-1 == g_gpshal_ctx.fd_mnl2hal_ext) { // error
LOGW("fd_mnl2hal_ext recreate fail, will retry after %d ms", GPSHAL_MNL_RETRY_INTERVAL);
mnldinf_start_timer(g_gpshal_ctx.mnl_retry_timer, GPSHAL_MNL_RETRY_INTERVAL);
+ return;
} else {
if (mnldinf_epoll_add_fd(
g_gpshal_ctx.fd_worker_epoll,
@@ -512,6 +520,9 @@
void connection_broken_ext() {
LOGW("extension connection broken...");
+ if (g_gpshal_ctx.fd_mnl2hal_ext != -1){
+ mnldinf_epoll_del_fd(g_gpshal_ctx.fd_worker_epoll, g_gpshal_ctx.fd_mnl2hal_ext);
+ }
mnldinf_start_timer(g_gpshal_ctx.mnl_retry_timer, GPSHAL_MNL_RETRY_INTERVAL);
}