summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorbernard <[email protected]>2014-08-01 13:25:58 +0800
committerbernard <[email protected]>2014-08-01 13:25:58 +0800
commitea598b9ac80de66767418b72665c2071a5de90fd (patch)
tree0c07e21efdd6e3ee0cf3f27cbdf5b2ea15e436f8 /components
parent833665405985c5978e008df6d259d8d9a505a36c (diff)
[DFS] fix copy command issue.
Diffstat (limited to 'components')
-rw-r--r--components/dfs/src/dfs_file.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/components/dfs/src/dfs_file.c b/components/dfs/src/dfs_file.c
index 32198371d7..d1a47aa9fa 100644
--- a/components/dfs/src/dfs_file.c
+++ b/components/dfs/src/dfs_file.c
@@ -629,7 +629,15 @@ static void copyfile(const char *src, const char *dst)
read_bytes = dfs_file_read(&src_fd, block_ptr, BUF_SZ);
if (read_bytes > 0)
{
- dfs_file_write(&fd, block_ptr, read_bytes);
+ int length;
+
+ length = dfs_file_write(&fd, block_ptr, read_bytes);
+ if (length != read_bytes)
+ {
+ /* write failed. */
+ rt_kprintf("Write file data failed, errno=%d\n", length);
+ break;
+ }
}
} while (read_bytes > 0);