diff options
| author | njoly <njoly@NetBSD.org> | 2009-07-22 15:49:29 +0000 |
|---|---|---|
| committer | njoly <njoly@NetBSD.org> | 2009-07-22 15:49:29 +0000 |
| commit | 3d5d2c8f61a66de6ebc070ced948a79d30e27fbf (patch) | |
| tree | e2af1fd2a4f10cc3e101d5ddf9ddd2f59746166d /sys | |
| parent | d493d48c2e0fa6739a75e9db24a51f989cfeaf0d (diff) | |
Make compat linux/linux32 getdents(2) fail with ENOTDIR instead of
EINVAL when file descriptor does not refer to a directory.
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/compat/linux/common/linux_misc.c | 6 | ||||
| -rw-r--r-- | sys/compat/linux32/common/linux32_dirent.c | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/sys/compat/linux/common/linux_misc.c b/sys/compat/linux/common/linux_misc.c index 3923a9cc549..dd0976efc9c 100644 --- a/sys/compat/linux/common/linux_misc.c +++ b/sys/compat/linux/common/linux_misc.c @@ -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 @@ linux_sys_getdents(struct lwp *l, const struct linux_sys_getdents_args *uap, reg vp = (struct vnode *)fp->f_data; if (vp->v_type != VDIR) { - error = EINVAL; + error = ENOTDIR; goto out1; } diff --git a/sys/compat/linux32/common/linux32_dirent.c b/sys/compat/linux32/common/linux32_dirent.c index 340fe14b24b..2c110be9aef 100644 --- a/sys/compat/linux32/common/linux32_dirent.c +++ b/sys/compat/linux32/common/linux32_dirent.c @@ -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 @@ linux32_sys_getdents(struct lwp *l, const struct linux32_sys_getdents_args *uap, vp = (struct vnode *)fp->f_data; if (vp->v_type != VDIR) { - error = EINVAL; + error = ENOTDIR; goto out1; } |
