aboutsummaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2003-12-15 04:16:42 +0000
committerChristopher Faylor <me@cgf.cx>2003-12-15 04:16:42 +0000
commit9908d9977b131249201b9c19219fd7d61fd65701 (patch)
treef57144fb183b3f75b68602d708a6704fde7be29a /winsup
parent228f99a6c1a60d778fe0182ad9e66b8cd755daf8 (diff)
downloadnewlib-9908d9977b131249201b9c19219fd7d61fd65701.zip
newlib-9908d9977b131249201b9c19219fd7d61fd65701.tar.gz
newlib-9908d9977b131249201b9c19219fd7d61fd65701.tar.bz2
* winsup.h (access_worker): Declare with added fhandler_base parameter.
* syscalls.cc (access_worker): Accommodate extra fhandler_base argument. Use it instead of stat_worker to determine stat information, when appropriate. * fhandler.cc (fhandler_base::device_access_denied): Pass fhandler pointer to access_worker so that it can use the proper method for determining stat information. * fhandler_disk_file.cc (fhandler_disk_file::opendir): Ditto.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog11
-rw-r--r--winsup/cygwin/fhandler.cc2
-rw-r--r--winsup/cygwin/fhandler_disk_file.cc2
-rw-r--r--winsup/cygwin/path.cc2
-rw-r--r--winsup/cygwin/syscalls.cc4
-rw-r--r--winsup/cygwin/winsup.h2
6 files changed, 17 insertions, 6 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 8bb5148..e747b67 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,16 @@
2003-12-14 Christopher Faylor <cgf@redhat.com>
+ * winsup.h (access_worker): Declare with added fhandler_base parameter.
+ * syscalls.cc (access_worker): Accommodate extra fhandler_base
+ argument. Use it instead of stat_worker to determine stat information,
+ when appropriate.
+ * fhandler.cc (fhandler_base::device_access_denied): Pass fhandler
+ pointer to access_worker so that it can use the proper method for
+ determining stat information.
+ * fhandler_disk_file.cc (fhandler_disk_file::opendir): Ditto.
+
+2003-12-14 Christopher Faylor <cgf@redhat.com>
+
* exceptions.cc (ctrl_c_handler): Remove this thread from the signal
handler chain.
diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc
index d9d3770..9be543a 100644
--- a/winsup/cygwin/fhandler.cc
+++ b/winsup/cygwin/fhandler.cc
@@ -328,7 +328,7 @@ fhandler_base::device_access_denied (int flags)
if (!mode)
mode |= R_OK;
- return access_worker (pc, mode);
+ return access_worker (pc, mode, this);
}
/* Open system call handler function. */
diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc
index a8e9ea8..f86432a 100644
--- a/winsup/cygwin/fhandler_disk_file.cc
+++ b/winsup/cygwin/fhandler_disk_file.cc
@@ -632,7 +632,7 @@ fhandler_disk_file::opendir ()
set_errno (ENOMEM);
goto free_dirname;
}
- else if (access_worker (pc, R_OK) != 0)
+ else if (access_worker (pc, R_OK, this) != 0)
goto free_dirent;
else
{
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 11350d2..d801a66 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -556,7 +556,7 @@ path_conv::check (const char *src, unsigned opt,
if (dev.major == DEV_CYGDRIVE_MAJOR)
{
if (!component)
- fileattr = FILE_ATTRIBUTE_DIRECTORY;
+ fileattr = FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_READONLY;
else
{
dev.devn = FH_FS;
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index 9922182..2bb701d 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -1240,7 +1240,7 @@ lstat (const char *name, struct __stat32 *buf)
}
int
-access_worker (path_conv& real_path, int flags)
+access_worker (path_conv& real_path, int flags, fhandler_base *fh)
{
if (real_path.error)
{
@@ -1268,7 +1268,7 @@ access_worker (path_conv& real_path, int flags)
return check_file_access (real_path, flags);
struct __stat64 st;
- int r = stat_worker (real_path, &st, 0);
+ int r = fh ? fh->fstat (&st) : stat_worker (real_path, &st, 0);
if (r)
return -1;
r = -1;
diff --git a/winsup/cygwin/winsup.h b/winsup/cygwin/winsup.h
index 26be3d0..2d60fcd 100644
--- a/winsup/cygwin/winsup.h
+++ b/winsup/cygwin/winsup.h
@@ -296,7 +296,7 @@ int symlink_worker (const char *, const char *, bool, bool)
__attribute__ ((regparm (3)));
class path_conv;
-int access_worker (path_conv&, int) __attribute__ ((regparm (2)));
+int access_worker (path_conv&, int, class fhandler_base * = NULL) __attribute__ ((regparm (3)));
int fcntl_worker (int fd, int cmd, void *arg);