From e0212e4146512823207cbf656e58ffc4e62a1d03 Mon Sep 17 00:00:00 2001 From: payton Date: Fri, 19 Jan 2024 16:07:25 +0800 Subject: [PATCH] =?UTF-8?q?1.sd=E5=8D=A1=E5=92=8Cqlog=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sf_app/code/source/app/sf_service.c | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/code/application/source/sf_app/code/source/app/sf_service.c b/code/application/source/sf_app/code/source/app/sf_service.c index eebb87b0e..dbfaa04f3 100755 --- a/code/application/source/sf_app/code/source/app/sf_service.c +++ b/code/application/source/sf_app/code/source/app/sf_service.c @@ -158,12 +158,6 @@ SF_BOOL app_disconnect_4g_module(void) { #if SF_QLOG_ENABLE static SINT16 app_Qlog_procress(void) { SINT16 s32ret = SF_SUCCESS; - char *file_path = sf_root_path_strcat(QLOG_PATH); - if(file_path == NULL) - { - free(file_path); - return SF_FAILURE; - } char qlogPath[128] = {0}; char qlogDirCmd[128] = {0}; @@ -172,10 +166,14 @@ static SINT16 app_Qlog_procress(void) { if(SF_FAILURE == sf_check_sd()) { MLOGE("ERROR sf_check_sd\n"); - free(file_path); return SF_FAILURE; } - + char *file_path = sf_root_path_strcat(QLOG_PATH); + if(file_path == NULL) + { + free(file_path); + return SF_FAILURE; + } time(&timep); p = gmtime(&timep); if (access(file_path, F_OK) != 0) { @@ -2417,6 +2415,7 @@ int sf_check_sd(void) { UINT8 i = 0; int ret = SF_SUCCESS; + int cnt = 0; if(0 == sf_in_card_exist() && (0 == sf_in_emmc_exist())) { NET_SLOGE("NO SD\r\n"); @@ -2437,10 +2436,14 @@ int sf_check_sd(void) { if (1 == sf_is_sdc_mounted()) { - ret = SF_SUCCESS; - MLOGI("mounted SD\r\n"); - sf_statistics_param_load(sf_statistics_param_get()); - break; + if(cnt > 3) + { + ret = SF_SUCCESS; + MLOGI("mounted SD\r\n"); + sf_statistics_param_load(sf_statistics_param_get()); + break; + } + cnt++; } sleep(1);