From ea598b9ac80de66767418b72665c2071a5de90fd Mon Sep 17 00:00:00 2001 From: bernard Date: Fri, 1 Aug 2014 13:25:58 +0800 Subject: [PATCH] [DFS] fix copy command issue. --- components/dfs/src/dfs_file.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/components/dfs/src/dfs_file.c b/components/dfs/src/dfs_file.c index 32198371d..d1a47aa9f 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); -- GitLab