Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2001-11-25 06:28:16 +0300
committerChristopher Faylor <me@cgf.cx>2001-11-25 06:28:16 +0300
commitded250563f2d756d91ccab996902ba5b8c47530c (patch)
treef540d63f262752ab9893de2e577e8db46869377f
parent21e379455ae6ab0f58ba55c5df3498363825ab7e (diff)
* fhandler_disk_file.cc (fhandler_cygdrive::readdir): Avoid reporting
inaccessible drives.
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/fhandler_disk_file.cc5
-rw-r--r--winsup/cygwin/fork.cc2
3 files changed, 11 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 9c44cb221..0118b20e3 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,10 @@
2001-11-24 Christopher Faylor <cgf@redhat.com>
+ * fhandler_disk_file.cc (fhandler_cygdrive::readdir): Avoid reporting
+ inaccessible drives.
+
+2001-11-24 Christopher Faylor <cgf@redhat.com>
+
* path.cc (path_conv::check): Tighten FH_CYGDRIVE check to avoid
matching trailing component, like other devices.
diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc
index 7a596b88b..1ce4893d2 100644
--- a/winsup/cygwin/fhandler_disk_file.cc
+++ b/winsup/cygwin/fhandler_disk_file.cc
@@ -804,6 +804,11 @@ fhandler_cygdrive::readdir (DIR *dir)
set_errno (ENMFILE);
return NULL;
}
+ if (GetFileAttributes (pdrive) == (DWORD) -1)
+ {
+ pdrive += DRVSZ;
+ return readdir (dir);
+ }
*dir->__d_dirent->d_name = cyg_tolower (*pdrive);
dir->__d_dirent->d_name[1] = '\0';
dir->__d_position++;
diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc
index a233ae4a2..8aa21a35c 100644
--- a/winsup/cygwin/fork.cc
+++ b/winsup/cygwin/fork.cc
@@ -545,7 +545,7 @@ fork_parent (HANDLE& hParent, dll *&first_dll,
slow_pid_reuse (pi.hProcess);
/* Wait for subproc to initialize itself. */
- if (!sync_with_child(pi, subproc_ready, TRUE, "waiting for longjmp"))
+ if (!sync_with_child (pi, subproc_ready, TRUE, "waiting for longjmp"))
goto cleanup;
/* CHILD IS STOPPED */