diff options
Diffstat (limited to 'sys/ufs/ext2fs/ext2fs_readwrite.c')
-rw-r--r-- | sys/ufs/ext2fs/ext2fs_readwrite.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/ufs/ext2fs/ext2fs_readwrite.c b/sys/ufs/ext2fs/ext2fs_readwrite.c index 9ae4322756f..30332a71ab5 100644 --- a/sys/ufs/ext2fs/ext2fs_readwrite.c +++ b/sys/ufs/ext2fs/ext2fs_readwrite.c @@ -195,6 +195,13 @@ ext2fs_write(v) panic("%s: mode", "ext2fs_write"); #endif + /* + * If writing 0 bytes, succeed and do not change + * update time or file offset (standards compliance) + */ + if (uio->uio_resid == 0) + return (0); + switch (vp->v_type) { case VREG: if (ioflag & IO_APPEND) |