Browse Source

Linux_SDK_V1.1.2

thead_admin 1 year ago
parent
commit
c9134b784c
1 changed files with 3 additions and 0 deletions
  1. 3 0
      solutions/fota-service/porting/flash.c

+ 3 - 0
solutions/fota-service/porting/flash.c

@@ -453,6 +453,7 @@ static int flash_close(netio_t *io)
         ret = -1;
         goto out;
     }
+    fflush(fp);
     fsync(fileno(fp));
 
     total_size = priv->head_size;
@@ -553,6 +554,7 @@ static int download_img_info_init(netio_t *io, uint8_t *buffer, int length, int
             fclose(headerfp);
             return -1;
         }
+        fflush(headerfp);
         fsync(fileno(headerfp));
         fclose(headerfp);
     }
@@ -587,6 +589,7 @@ static int download_img_info_init(netio_t *io, uint8_t *buffer, int length, int
         fclose(imginfofp);
         return -1;
     }
+    fflush(imginfofp);
     fsync(fileno(imginfofp));
     fclose(imginfofp);