Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Sep 1995 23:30:01 -0700 (PDT)
From:      Julian Elischer <julian@ref.tfs.com>
To:        bde@zeta.org.au (Bruce Evans)
Cc:        davidg@freefall.freebsd.org, hackers@freefall.freebsd.org, julian@freefall.freebsd.org
Subject:   Re: bug in 4.4lite (fixed in lite2)
Message-ID:  <199509090630.XAA00624@ref.tfs.com>
In-Reply-To: <199509090509.PAA13536@godzilla.zeta.org.au> from "Bruce Evans" at Sep 9, 95 03:09:01 pm

next in thread | previous in thread | raw e-mail | index | archive | help
I take your point
and conclude that the people doing posix must have been very confused
however what lite was doing before (removing the target and leaving
the source) isn't right by posix either. 
I think it makes sense to make the semantic the same
whether or not the two are linked..
however maybe we need to take a vote on it..
I notice that 4.4lite2 voted with me on this, and
wonder if there is a newer version of posix they may have referenced on this..


> 
> >[4.4lite]...
> >is back to front.. all the t (to) variables should be f (from) and visa versa.
> 
> >touch a
> >ln a b
> >mv a b
> 
> >results in a  remaining and b being deleted
> 
> I can't test this here, because I implemented the POSIX spec, which clearly
> although probably incorrectly specifies that the rename() shall do nothing:
> 
> "
> 5.5.3.2 ...
> If the old argument and the new argument both refer to links to the same
>                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^
> existing file, the rename() function shall return successfully and perform
> ^^^^^^^^^^^^^
> no other action.
> "
> 
> 4.4lite only does nothing if the old argument and the new argument refer
> to the same directory entry.  A `file' is quite different from a `directory
> entry' in the context of functions such as unlink() and rename() that
> operate on directory entries.
> 
> >[4.4lite2]
> >get's it right..
> >I just noticed this when adding rename to devfs..
> >but 4.4l2 noticed before me :)
> 
> msdosfs is probably broken too (apart from msdosfs_rename() being broken
> in other ways).
> 
> Bruce
> 
> *** vfs_syscalls.c~	Tue Aug 29 03:53:24 1995
> --- vfs_syscalls.c	Wed Sep  6 20:41:50 1995
> ***************
> *** 1844,1847 ****
> --- 1845,1849 ----
>   	if (fvp == tdvp)
>   		error = EINVAL;
> + #if 0
>   	/*
>   	 * If source is the same as the destination (that is the
> ***************
> *** 1854,1857 ****
> --- 1856,1868 ----
>   	      fromnd.ni_cnd.cn_namelen))
>   		error = -1;
> + #else
> + 	/*
> + 	 * 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.
> + 	 * POSIX standard.
> + 	 */
> + 	if (fvp == tvp)
> + 		error = -1;
> + #endif
>   out:
>   	if (!error) {
> 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199509090630.XAA00624>