# HG changeset patch # User charles # Date 1242095031 -3600 # Node ID 3e4a1f10896a50518498e5b0b08f70aec250dfad # Parent 4ba81e953434d45379ae2967a669decfe4f06623 Fix -ENOSPC to work properly with zero length writes diff --git a/yaffs_fs.c b/yaffs_fs.c --- a/yaffs_fs.c +++ b/yaffs_fs.c @@ -1075,7 +1075,7 @@ static ssize_t yaffs_file_write(struct f } yaffs_GrossUnlock(dev); - return nWritten == 0 ? -ENOSPC : nWritten; + return (nWritten == 0) && (n > 0) ? -ENOSPC : nWritten; } /* Space holding and freeing is done to ensure we have space available for write_begin/end */