[Bugfix][bug-view-366][FOTA]During the FOTA all inclusive upgrade process, there will be a coredump probability of network failure

Only Configure: No
Affected branch: ZK-first-oem-release
Affected module: FOTA
Is it affected on both ZXIC and MTK: only MTK
Self-test: yes
Doc Update: No

Change-Id: Ia7f74329fd49d42df9af4540d9ba6e48367e367b
diff --git a/LYNQ_PUBLIC/IC_src/mtk/lib/liblynq-ftp-fota/rock_ua/rock_ua.cpp b/LYNQ_PUBLIC/IC_src/mtk/lib/liblynq-ftp-fota/rock_ua/rock_ua.cpp
index 5fd004f..f434a35 100755
--- a/LYNQ_PUBLIC/IC_src/mtk/lib/liblynq-ftp-fota/rock_ua/rock_ua.cpp
+++ b/LYNQ_PUBLIC/IC_src/mtk/lib/liblynq-ftp-fota/rock_ua/rock_ua.cpp
@@ -272,7 +272,7 @@
         std::string strFtpCmd = "curl -o " + m_strTempFileName + " " + g_strFtpAddress + range;
 
         ret = system(strFtpCmd.c_str());
-        if (ret < 0)
+        if (ret != 0)
         {
             RLOGE("+[UA]: down load file fail [ %s ]\n", strFtpCmd.c_str());
             return false;
@@ -282,6 +282,11 @@
             memset(digest_s,0,SHA_DIGEST_SIZE);
 
             fd=open(m_strTempFileName.c_str(),O_RDONLY);
+            if(fd < 0)
+            {
+                RLOGE("+[UA]: open file fail\n");
+                return false;
+            }
             ROCK_SHA_FILE_COMMON(fd ,0 ,pt_info->part_size, digest_s);
             close(fd);
             if (memcmp(digest_s, pt_info->part_sha, SHA_DIGEST_SIZE) != 0)