[bugfix][T108][bug-view-1120/1161] ota maybe block if repeat upgrade no reboot and get current system faild
Only Configure: No
Affected branch:LYNQ_SDK_ASR_T108_V05.04.01.00
Affected module: fota
Is it affected on IC: only ASR
Self-test: yes
Doc Update: no
Change-Id: I7e5de43bf03aec9188c1891e9482895de9765007
diff --git a/mbtk/libql_lib_v2_rilv2/ql_fota_api.c b/mbtk/libql_lib_v2_rilv2/ql_fota_api.c
index 9b833da..3dac4c9 100755
--- a/mbtk/libql_lib_v2_rilv2/ql_fota_api.c
+++ b/mbtk/libql_lib_v2_rilv2/ql_fota_api.c
@@ -16,6 +16,7 @@
#define StatFunc(x,y) stat(x,y)
+static int s_ota_flag = -1;
int funstat( char *filename)
{
int ret = 0;
@@ -52,11 +53,18 @@
int ret = 0;
int len = 0;
- ret = mbtk_fota_init(ql_fota_cb);
- if (ret)
+ if(s_ota_flag == -1)
{
- LOGE("ql_abfota_start_update init fail");
- return -1;
+ ret = mbtk_fota_init(ql_fota_cb);
+ if (ret)
+ {
+ LOGE("ql_abfota_start_update init fail");
+ return -1;
+ }
+ else
+ {
+ s_ota_flag = 0;
+ }
}
memset(addr_buf, 0, sizeof(addr_buf));