summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_extattr.c
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1995-11-18 11:35:05 +0000
committerbde <bde@FreeBSD.org>1995-11-18 11:35:05 +0000
commitfc2b88c806acd1b512b39021639befaacc7c4005 (patch)
tree5e0d108c4b16da96c5a74dacab914bdcdad7f4c3 /sys/kern/vfs_extattr.c
parent5c94c57f3f02a37f424379ee1ed3be703ef65b18 (diff)
downloadFreeBSD-src-fc2b88c806acd1b512b39021639befaacc7c4005.zip
FreeBSD-src-fc2b88c806acd1b512b39021639befaacc7c4005.tar.gz
Fixed the errno returned by rename("dir1", "dir2/."). It was EISDIR
(duh); translate it to EINVAL which is the errno for other renames to ".".
Diffstat (limited to 'sys/kern/vfs_extattr.c')
-rw-r--r--sys/kern/vfs_extattr.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c
index a2c37df..31b955a 100644
--- a/sys/kern/vfs_extattr.c
+++ b/sys/kern/vfs_extattr.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
- * $Id: vfs_syscalls.c,v 1.39 1995/11/13 08:22:21 bde Exp $
+ * $Id: vfs_syscalls.c,v 1.40 1995/11/14 09:19:16 phk Exp $
*/
#include <sys/param.h>
@@ -1880,6 +1880,10 @@ rename(p, uap, retval)
tond.ni_cnd.cn_flags |= WILLBEDIR;
error = namei(&tond);
if (error) {
+ /* Translate error code for rename("dir1", "dir2/."). */
+ if (error == EISDIR && fvp->v_type == VDIR)
+ error = EINVAL;
+
VOP_ABORTOP(fromnd.ni_dvp, &fromnd.ni_cnd);
vrele(fromnd.ni_dvp);
vrele(fvp);
OpenPOWER on IntegriCloud