[Feature][ZXW-41] merged 0601 version
Change-Id: I667af6bb09d65581d455b73f8984c160b2c67ad8
diff --git a/ap/app/fs_check/mtd.c b/ap/app/fs_check/mtd.c
index 9a60714..633b625 100755
--- a/ap/app/fs_check/mtd.c
+++ b/ap/app/fs_check/mtd.c
@@ -804,11 +804,11 @@
ret = -1;
goto out;
}
- ret = write(fd_mtd, buf, meminfo.erasesize);
- if (ret != meminfo.erasesize)
+ ret = write(fd_mtd, buf, (size_t)meminfo.erasesize);
+ if (ret < 0 || ret != meminfo.erasesize)
{
- printf("fs_check mtd, write error = %d!\n", ret);
- sc_debug_info_record(MODULE_ID_AP_FS_CHECK, "fs_check mtd, write error = %d!\n", ret);
+ printf("fs_check mtd, write %s error = %d!\n", partition_name, ret);
+ sc_debug_info_record(MODULE_ID_AP_FS_CHECK, "fs_check mtd, write %s error = %d!\n", partition_name, ret);
ret = -1;
goto out;
}