commit | 7c71b2f3e39768b1fa1b2f4441a70ca89461afef | [log] [tgz] |
---|---|---|
author | hong.liu <hong.liu@mobiletek.cn> | Thu Aug 08 06:20:17 2024 +0000 |
committer | Gerrit Code Review <gerrit@aab99bac79d8> | Thu Aug 08 06:20:17 2024 +0000 |
tree | 77cd7b55f081d83f333178e8bf32a5d8e9e15e73 | |
parent | 711b18645fabfaf5275d805e9777f9b7d67d1c99 [diff] | |
parent | 610b48624d02558346c4835b2f224f48811448e6 [diff] |
Merge "[Bugfix][T106][task-view-57]Solve file handle may not right close"
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-fota-backup/files/lynq-fota-backup.cpp b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-fota-backup/files/lynq-fota-backup.cpp index 5fff5eb..c2e7d1d 100755 --- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-fota-backup/files/lynq-fota-backup.cpp +++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-fota-backup/files/lynq-fota-backup.cpp
@@ -144,9 +144,11 @@ if(ret < 0 ) { LYERRLOG("A/B sync system failed \n"); + fclose(fp); return -1; } LYINFLOG("A/B sync system success,record current sys \n"); + fclose(fp); fp = fopen(FOTA_CURRENT_SYS,"w"); if(fp == NULL) { @@ -158,7 +160,6 @@ fclose(fp); system("sync"); - return 0; } } @@ -178,6 +179,7 @@ if(current_sys < 0) { LYERRLOG("Get current system failed %d\n",current_sys); + fclose(fp); return -1; }