Mercurial > yaffs-ecoscentric
diff yaffs_fs.c @ 116:c110f6f02466
Handle partial writes more gracefully: return partial byte counts, return
ENOSPC only if no partial count or error code available. Based on fix
from Mikhail Ryleev.
| author | tpoynor |
|---|---|
| date | Wed, 25 Jan 2006 01:21:08 +0000 |
| parents | 448c45ce46b0 |
| children | 5f0adbb370c9 |
line wrap: on
line diff
--- a/yaffs_fs.c +++ b/yaffs_fs.c @@ -628,9 +628,9 @@ static int yaffs_commit_write(struct fil T(YAFFS_TRACE_OS, (KERN_DEBUG "yaffs_commit_write returning %d\n", - nWritten == nBytes ? 0 : -1)); + nWritten == nBytes ? 0 : nWritten)); - return nWritten == nBytes ? 0 : -1; + return nWritten == nBytes ? 0 : nWritten; } @@ -788,8 +788,7 @@ static ssize_t yaffs_file_write(struct f } yaffs_GrossUnlock(dev); - - return nWritten != n ? -ENOSPC : nWritten; + return nWritten == 0 ? -ENOSPC : nWritten; } static int yaffs_readdir(struct file *f, void *dirent, filldir_t filldir)
