[1.7] rename/renameat error

Eric Blake ebb9@byu.net
Wed Sep 23 12:59:00 GMT 2009

Hash: SHA1

According to Eric Blake on 9/22/2009 3:02 PM:
> I've got a patch in testing for both of these issues.

Does this look okay to apply?  The fix in path.cc affects more than just
link, hence I had to add a new option to keep mkdir("d/",mode) still
working, while link("file","d/") now fails with the same ENOENT as Linux.
 rename was tricky, as rename("file","d/") must fail whether or not d
exists, while rename("dir","d/") must succeed if d does not exist or
exists and is empty.  I think I got it all, but it can't hurt to
double-check things.

2009-09-23  Eric Blake  <ebb9@byu.net>

	* path.h (PC_MKDIR): New enum value.
	* path.cc (check): Ensure 'a/' resolves to a directory.
	* syscalls.cc (link): Fix comment.
	(rename): Use correct errno for trailing '.'.  Allow trailing
	slash to newpath iff oldpath is directory.
	* dir.cc (mkdir): Allow trailing slash.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@byu.net
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cygwin.patch21
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20090923/3b4f4b54/attachment.ksh>

More information about the Cygwin-patches mailing list