[Bugfix][API-1395]add mnld tmp-file machine-made to determined if mnld is ready

Only Configure:No
Affected branch:GSW3.0-No-Connman
Affected module:GNSS
Is it affected on both ZXIC and MTK:only MTK,
Self-test:Yes,
Doc Update:NO.

Change-Id: I73ff3f864c5e66e16a09731ee52287e1e16aa27d
diff --git a/src/connectivity/gps/2.0/mtk_mnld/mnld_entity/src/mnld.c b/src/connectivity/gps/2.0/mtk_mnld/mnld_entity/src/mnld.c
index 3411b98..d32a295 100755
--- a/src/connectivity/gps/2.0/mtk_mnld/mnld_entity/src/mnld.c
+++ b/src/connectivity/gps/2.0/mtk_mnld/mnld_entity/src/mnld.c
@@ -7,6 +7,8 @@
 #include <stdio.h>
 #include <sys/time.h>
 #include <sys/socket.h>
+#include <sys/types.h>
+#include <fcntl.h>
 #include <time.h>
 #include <signal.h>
 #if defined(__ANDROID_OS__)
@@ -3530,7 +3532,7 @@
 int main(int argc, char** argv) {
     mnld_wake_lock_init();
     mnld_wake_lock_take();
-    LOGD("mnld version=%s\n", MNLD_VERSION);
+    LOGE("mnld version=%s\n", MNLD_VERSION);
     daemon_parse_commandline(argc, argv);
 
     set_signal_ignore(SIGPIPE);
@@ -3595,9 +3597,11 @@
     if ((argc >= 3)  //Parameter count check
         && (!strncmp(argv[2], "meta", 4) || !strncmp(argv[2], "factory", 7)
         || !strncmp(argv[2], "test", 4) || !strncmp(argv[2], "PDNTest", 7))) {
+        LOGE("enter not normal mode\n");
         mnld_factory_test_entry(argc, argv);
         mnld_wake_lock_give();
     } else {
+        LOGE("enter normal mode\n");
         gps_control_init();
         epo_downloader_init();
         qepo_downloader_init();
@@ -3607,6 +3611,21 @@
         mpe_function_init();
     #endif
         mnld_init();
+
+        /*lcz add mnld.server to determined if mnld is ready.start. 2023/10/26/ */
+        int fd=0;
+        fd = open("/tmp/mnld.server",O_CREAT|O_RDONLY,0744);
+        LOGE("tmp-file open\n");
+        if(fd < 0)
+        {
+            LOGE("open error: %d (%s)\n", errno, strerror(errno));
+        }
+        else
+        {
+            close(fd);
+        }
+        /*lcz add mnld.server to determined if mnld is ready.end. 2023/10/26/ */
+
         // For MNL5.9 and later version, we move flp_monitor_init after mnld_init,
         // creating that the monitor thread after mnld msg socket initialized,
         // then the screen status can be send to mnld main thread without concern