This is the mail archive of the
cygwin-patches@cygwin.com
mailing list for the Cygwin project.
Re: [Patch]: mkdir -p and network drives
- From: "Pierre A. Humblet" <pierre at phumblet dot no-ip dot org>
- To: Eric Blake <ebb9 at byu dot net>,cygwin-patches at cygwin dot com
- Date: Mon, 09 May 2005 20:16:36 -0400
- Subject: Re: [Patch]: mkdir -p and network drives
- References: <3.0.5.32.20050505225708.00b64250@incoming.verizon.net>
At 06:19 PM 5/9/2005 +0000, Eric Blake wrote:
>Second, the sequence chdir("//"), mkdir("machine") creates machine in the
>current directory.
Old bug.
chdir("/proc"), mkdir("machine") produces the same result.
And mkdir("/proc"), mkdir("/proc/machine") creates c:\proc\machine
The fix sets errno to EROFS, which is what rmdir is already doing.
Is that OK for coreutils?
Pierre
2005-05-10 Pierre Humblet <pierre.humblet@ieee.org>
* dir.cc (isrofs): New function.
(mkdir): Use isrofs.
(rmdir): Ditto.
Index: dir.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/dir.cc,v
retrieving revision 1.84
diff -r1.84 dir.cc
218a219,225
> inline bool
> isrofs(DWORD devn)
> {
> return devn == FH_PROC || devn == FH_REGISTRY
> || devn == FH_PROCESS || devn == FH_NETDRIVE;
> }
>
233a241,245
> else if (isrofs (real_dir.get_devn ()))
> {
> set_errno (EROFS);
> goto done;
> }
266d277
< DWORD devn;
272,273c283
< else if ((devn = real_dir.get_devn ()) == FH_PROC || devn == FH_REGISTRY
< || devn == FH_PROCESS)
---
> else if (isrofs (real_dir.get_devn ()))