Module Name: src Committed By: njoly Date: Wed Jul 22 15:49:29 UTC 2009
Modified Files: src/sys/compat/linux/common: linux_misc.c src/sys/compat/linux32/common: linux32_dirent.c Log Message: Make compat linux/linux32 getdents(2) fail with ENOTDIR instead of EINVAL when file descriptor does not refer to a directory. To generate a diff of this commit: cvs rdiff -u -r1.208 -r1.209 src/sys/compat/linux/common/linux_misc.c cvs rdiff -u -r1.8 -r1.9 src/sys/compat/linux32/common/linux32_dirent.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/compat/linux/common/linux_misc.c diff -u src/sys/compat/linux/common/linux_misc.c:1.208 src/sys/compat/linux/common/linux_misc.c:1.209 --- src/sys/compat/linux/common/linux_misc.c:1.208 Fri May 15 17:02:54 2009 +++ src/sys/compat/linux/common/linux_misc.c Wed Jul 22 15:49:29 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_misc.c,v 1.208 2009/05/15 17:02:54 pooka Exp $ */ +/* $NetBSD: linux_misc.c,v 1.209 2009/07/22 15:49:29 njoly Exp $ */ /*- * Copyright (c) 1995, 1998, 1999, 2008 The NetBSD Foundation, Inc. @@ -57,7 +57,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.208 2009/05/15 17:02:54 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.209 2009/07/22 15:49:29 njoly Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -702,7 +702,7 @@ vp = (struct vnode *)fp->f_data; if (vp->v_type != VDIR) { - error = EINVAL; + error = ENOTDIR; goto out1; } Index: src/sys/compat/linux32/common/linux32_dirent.c diff -u src/sys/compat/linux32/common/linux32_dirent.c:1.8 src/sys/compat/linux32/common/linux32_dirent.c:1.9 --- src/sys/compat/linux32/common/linux32_dirent.c:1.8 Mon Dec 29 14:33:40 2008 +++ src/sys/compat/linux32/common/linux32_dirent.c Wed Jul 22 15:49:29 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: linux32_dirent.c,v 1.8 2008/12/29 14:33:40 njoly Exp $ */ +/* $NetBSD: linux32_dirent.c,v 1.9 2009/07/22 15:49:29 njoly Exp $ */ /*- * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved. @@ -33,7 +33,7 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux32_dirent.c,v 1.8 2008/12/29 14:33:40 njoly Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux32_dirent.c,v 1.9 2009/07/22 15:49:29 njoly Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -126,7 +126,7 @@ vp = (struct vnode *)fp->f_data; if (vp->v_type != VDIR) { - error = EINVAL; + error = ENOTDIR; goto out1; }