diff options
| author | bernard <[email protected]> | 2014-08-01 13:25:58 +0800 |
|---|---|---|
| committer | bernard <[email protected]> | 2014-08-01 13:25:58 +0800 |
| commit | ea598b9ac80de66767418b72665c2071a5de90fd (patch) | |
| tree | 0c07e21efdd6e3ee0cf3f27cbdf5b2ea15e436f8 /components | |
| parent | 833665405985c5978e008df6d259d8d9a505a36c (diff) | |
[DFS] fix copy command issue.
Diffstat (limited to 'components')
| -rw-r--r-- | components/dfs/src/dfs_file.c | 10 |
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); |
