From: charles Date: Tue, 12 May 2009 02:23:51 +0000 (+0000) Subject: Fix -ENOSPC to work properly with zero length writes X-Git-Tag: pre-name-change~209 X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=commitdiff_plain;h=d3b4b66f3437d0bceb21f3e3696517d1c43dc86c;hp=b027e02d89da77f2977c2af70f661274be3c2228;ds=sidebyside Fix -ENOSPC to work properly with zero length writes --- diff --git a/yaffs_fs.c b/yaffs_fs.c index 7c04ed3..ed247f9 100644 --- a/yaffs_fs.c +++ b/yaffs_fs.c @@ -32,7 +32,7 @@ */ const char *yaffs_fs_c_version = - "$Id: yaffs_fs.c,v 1.79 2009-03-17 01:12:00 wookey Exp $"; + "$Id: yaffs_fs.c,v 1.80 2009-05-12 02:23:51 charles Exp $"; extern const char *yaffs_guts_c_version; #include @@ -1075,7 +1075,7 @@ static ssize_t yaffs_file_write(struct file *f, const char *buf, size_t n, } 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 */