diff options
Diffstat (limited to 'sys/kern/vfs_syscalls.c')
-rw-r--r-- | sys/kern/vfs_syscalls.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 3015105..e1b2d7f 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -2744,14 +2744,10 @@ kern_rename(struct thread *td, char *from, char *to, enum uio_seg pathseg) if (fvp == tdvp) error = EINVAL; /* - * If source is the same as the destination (that is the - * same inode number with the same name in the same directory), - * then there is nothing to do. + * If the source is the same as the destination (that is, if they + * are links to the same vnode), then there is nothing to do. */ - if (fvp == tvp && fromnd.ni_dvp == tdvp && - fromnd.ni_cnd.cn_namelen == tond.ni_cnd.cn_namelen && - !bcmp(fromnd.ni_cnd.cn_nameptr, tond.ni_cnd.cn_nameptr, - fromnd.ni_cnd.cn_namelen)) + if (fvp == tvp) error = -1; out: if (!error) { |