Skip to content

Commit ea598b9

Browse files
committed
[DFS] fix copy command issue.
1 parent 8336654 commit ea598b9

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

components/dfs/src/dfs_file.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,15 @@ static void copyfile(const char *src, const char *dst)
629629
read_bytes = dfs_file_read(&src_fd, block_ptr, BUF_SZ);
630630
if (read_bytes > 0)
631631
{
632-
dfs_file_write(&fd, block_ptr, read_bytes);
632+
int length;
633+
634+
length = dfs_file_write(&fd, block_ptr, read_bytes);
635+
if (length != read_bytes)
636+
{
637+
/* write failed. */
638+
rt_kprintf("Write file data failed, errno=%d\n", length);
639+
break;
640+
}
633641
}
634642
} while (read_bytes > 0);
635643

0 commit comments

Comments
 (0)