diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 9c44cb221..0118b20e3 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2001-11-24 Christopher Faylor + + * fhandler_disk_file.cc (fhandler_cygdrive::readdir): Avoid reporting + inaccessible drives. + 2001-11-24 Christopher Faylor * path.cc (path_conv::check): Tighten FH_CYGDRIVE check to avoid 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 */