From 3d5d2c8f61a66de6ebc070ced948a79d30e27fbf Mon Sep 17 00:00:00 2001 From: njoly Date: Wed, 22 Jul 2009 15:49:29 +0000 Subject: Make compat linux/linux32 getdents(2) fail with ENOTDIR instead of EINVAL when file descriptor does not refer to a directory. --- sys/compat/linux/common/linux_misc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/compat/linux') 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 -__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 #include @@ -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; } -- cgit