Module Name: src Committed By: maxv Date: Sun Feb 16 12:54:07 UTC 2014
Modified Files: src/sys/fs/tmpfs: tmpfs_vnops.c Log Message: Fix tmpfs_read()'s return value; it should return EINVAL. Now consistent with tmpfs_write(). ok christos@ To generate a diff of this commit: cvs rdiff -u -r1.115 -r1.116 src/sys/fs/tmpfs/tmpfs_vnops.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/fs/tmpfs/tmpfs_vnops.c diff -u src/sys/fs/tmpfs/tmpfs_vnops.c:1.115 src/sys/fs/tmpfs/tmpfs_vnops.c:1.116 --- src/sys/fs/tmpfs/tmpfs_vnops.c:1.115 Fri Feb 7 15:29:22 2014 +++ src/sys/fs/tmpfs/tmpfs_vnops.c Sun Feb 16 12:54:07 2014 @@ -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 @@ tmpfs_read(void *v) 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; }