Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/fs/tmpfs Fix tmpfs_read()'s return value; it should retu...



details:   https://anonhg.NetBSD.org/src/rev/83a16fd9242c
branches:  trunk
changeset: 326752:83a16fd9242c
user:      maxv <maxv%NetBSD.org@localhost>
date:      Sun Feb 16 12:54:07 2014 +0000

description:
Fix tmpfs_read()'s return value; it should return EINVAL. Now consistent with
tmpfs_write().

ok christos@

diffstat:

 sys/fs/tmpfs/tmpfs_vnops.c |  9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diffs (30 lines):

diff -r c3eb5c858f0a -r 83a16fd9242c sys/fs/tmpfs/tmpfs_vnops.c
--- a/sys/fs/tmpfs/tmpfs_vnops.c        Sun Feb 16 11:26:31 2014 +0000
+++ b/sys/fs/tmpfs/tmpfs_vnops.c        Sun Feb 16 12:54:07 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tmpfs_vnops.c,v 1.115 2014/02/07 15:29:22 hannken Exp $        */
+/*     $NetBSD: tmpfs_vnops.c,v 1.116 2014/02/16 12:54:07 maxv Exp $   */
 
 /*
  * Copyright (c) 2005, 2006, 2007 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tmpfs_vnops.c,v 1.115 2014/02/07 15:29:22 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tmpfs_vnops.c,v 1.116 2014/02/16 12:54:07 maxv Exp $");
 
 #include <sys/param.h>
 #include <sys/dirent.h>
@@ -534,10 +534,7 @@
 
        KASSERT(VOP_ISLOCKED(vp));
 
-       if (vp->v_type != VREG) {
-               return EISDIR;
-       }
-       if (uio->uio_offset < 0) {
+       if (uio->uio_offset < 0 || vp->v_type != VREG) {
                return EINVAL;
        }
 



Home | Main Index | Thread Index | Old Index