aboutsummaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2005-10-12 20:38:38 +0000
committerChristopher Faylor <me@cgf.cx>2005-10-12 20:38:38 +0000
commitbf1550b6f8387fe892c6e6e1c86316634a0604ae (patch)
tree7d9311a5cda548bc12d789eec3b78f77b43714c3 /winsup
parent48882f9a07b5fcc2a892387d9af079a774482f1e (diff)
downloadnewlib-bf1550b6f8387fe892c6e6e1c86316634a0604ae.zip
newlib-bf1550b6f8387fe892c6e6e1c86316634a0604ae.tar.gz
newlib-bf1550b6f8387fe892c6e6e1c86316634a0604ae.tar.bz2
* dir.cc (mkdir): Abandon use of PC_WRITABLE.
(rmdir): Ditto. * path.h (PC_WRITABLE): Delete. * path.cc (path_conv::check): Remove PC_WRITABLE accommodations. Revisit later.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog8
-rw-r--r--winsup/cygwin/dir.cc9
-rw-r--r--winsup/cygwin/path.cc9
-rw-r--r--winsup/cygwin/path.h3
4 files changed, 16 insertions, 13 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index a6823a8..49afc78 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,11 @@
+2005-10-12 Christopher Faylor <cgf@timesys.com>
+
+ * dir.cc (mkdir): Abandon use of PC_WRITABLE.
+ (rmdir): Ditto.
+ * path.h (PC_WRITABLE): Delete.
+ * path.cc (path_conv::check): Remove PC_WRITABLE accommodations.
+ Revisit later.
+
2005-10-12 Corinna Vinschen <corinna@vinschen.de>
* fhandler_disk_file.cc (fhandler_disk_file::rmdir): Convert an
diff --git a/winsup/cygwin/dir.cc b/winsup/cygwin/dir.cc
index c6b318e..0d25619 100644
--- a/winsup/cygwin/dir.cc
+++ b/winsup/cygwin/dir.cc
@@ -265,7 +265,7 @@ mkdir (const char *dir, mode_t mode)
return -1;
}
- if (!(fh = build_fh_name (dir, NULL, PC_SYM_NOFOLLOW | PC_WRITABLE)))
+ if (!(fh = build_fh_name (dir, NULL, PC_SYM_NOFOLLOW)))
goto done; /* errno already set */;
if (fh->error ())
@@ -299,13 +299,16 @@ rmdir (const char *dir)
return -1;
}
- if (!(fh = build_fh_name (dir, NULL, PC_SYM_NOFOLLOW | PC_WRITABLE)))
+ if (!(fh = build_fh_name (dir, NULL, PC_SYM_NOFOLLOW)))
goto done; /* errno already set */;
if (fh->error ())
{
debug_printf ("got %d error from build_fh_name", fh->error ());
- set_errno (fh->error ());
+ if (fh->error ())
+ set_errno (EROFS);
+ else
+ set_errno (fh->error ());
}
else if (!fh->rmdir ())
res = 0;
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 57b10dc..6f0f950 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -925,14 +925,7 @@ virtual_component_retry:
out:
bool strip_tail = false;
- /* If the user wants a directory, do not return a symlink */
- if ((opt & PC_WRITABLE) && (path_flags & PATH_RO))
- {
- debug_printf ("%s is on a read-only filesystem", path);
- error = EROFS;
- return;
- }
- else if (dev.devn == FH_NETDRIVE && component)
+ if (dev.devn == FH_NETDRIVE && component)
{
/* This case indicates a non-existant resp. a non-retrievable
share. This happens for instance if the share is a printer.
diff --git a/winsup/cygwin/path.h b/winsup/cygwin/path.h
index aeb70c0..e2fa224 100644
--- a/winsup/cygwin/path.h
+++ b/winsup/cygwin/path.h
@@ -46,8 +46,7 @@ enum pathconv_arg
PC_NULLEMPTY = 0x0020,
PC_CHECK_EA = 0x0040,
PC_POSIX = 0x0080,
- PC_NO_ACCESS_CHECK = 0x00800000,
- PC_WRITABLE = 0x00400000
+ PC_NO_ACCESS_CHECK = 0x00800000
};
enum case_checking