* fhandler.h (dirent_states): Add dirent_saw_proc.

* fhandler_disk_file.cc (fhandler_disk_file::readdir): Fill in "proc" if it is
the root dir and it is missing.
This commit is contained in:
Christopher Faylor 2005-08-19 16:29:43 +00:00
parent 358063ace3
commit 683ef95392
3 changed files with 16 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2005-08-19 Christopher Faylor <cgf@timesys.com>
* fhandler.h (dirent_states): Add dirent_saw_proc.
* fhandler_disk_file.cc (fhandler_disk_file::readdir): Fill in "proc"
if it is the root dir and it is missing.
2005-08-19 Christopher Faylor <cgf@timesys.com>
* fhandler.h (dirent_states): Add dirent_isroot, dirent_saw_cygdrive,

View File

@ -46,7 +46,8 @@ enum dirent_states
dirent_saw_eof = 0x0004,
dirent_isroot = 0x0008,
dirent_saw_cygdrive = 0x0010,
dirent_saw_dev = 0x0020
dirent_saw_dev = 0x0020,
dirent_saw_proc = 0x0040
};
enum conn_state

View File

@ -1379,6 +1379,11 @@ fhandler_disk_file::readdir (DIR *dir)
strcpy (buf.cFileName, "dev");
added = true;
}
else if (!(dir->__flags & dirent_saw_proc))
{
strcpy (buf.cFileName, "proc");
added = true;
}
else if (!(dir->__flags & dirent_saw_cygdrive)
&& mount_table->cygdrive_len > 1)
{
@ -1425,12 +1430,12 @@ fhandler_disk_file::readdir (DIR *dir)
fnunmunge (dir->__d_dirent->d_name, buf.cFileName);
else
strcpy (dir->__d_dirent->d_name, buf.cFileName);
if (!(dir->__flags && dirent_isroot))
/* nothing */;
else
if (dir->__flags && dirent_isroot)
{
if (strcasematch (dir->__d_dirent->d_name, "dev"))
dir->__flags |= dirent_saw_dev;
else if (strcasematch (dir->__d_dirent->d_name, "proc"))
dir->__flags |= dirent_saw_proc;
if (strlen (dir->__d_dirent->d_name) == mount_table->cygdrive_len - 2
&& strncasematch (dir->__d_dirent->d_name, mount_table->cygdrive + 1,
mount_table->cygdrive_len - 2))