* path.h (pathconv_arg): Add PC_POSIX.

(path_conv): Add normalized_path field.
* path.cc (path_conv::~path_conv): New destructor.
(path_conv::check): Set normalized_path, where appropriate.
* dtable.cc (build_fhandler_from_name): Use normalized path from path_conv.
* syscalls.cc (chroot): Ditto.
* cygheap.h: Remove path_prefix_p declaration.  Christopher Faylor
<cgf@redhat.com> (minor fixups)
* Makefile.in: Add fhandler_proc.o, fhandler_registry.o, fhandler_process.o and
fhandler_virtual.o.
* dtable.cc (dtable::build_fhandler): Add entries for FH_PROC, FH_REGISTRY and
FH_PROCESS.  Set unix_name to the normalized posix path.
* fhandler.h: Add constants for FH_PROC, FH_REGISTRY and FH_PROCESS.  Add class
declarations for fhandler_virtual, fhandler_proc, fhandler_registry and
fhandler_virtual.  Update fhandler_union accordingly.
* fhandler_proc.cc: New file.  Add implementation for fhandler_proc.
* fhandler_virtual.cc: New file.  Add implementation for fhandler_virtual.
* fhandler_process.cc: New file.  Add implementation for fhandler_process.
* fhandler_registry.cc: New file.  Add implementation for fhandler_registry.
* path.cc: Add isproc and isvirtual_dev macros.
* path.cc (path_conv::check): Add check for virtual devices.
* path.cc (mount_info::conv_to_win32_path): Convert paths in /proc to empty
Win32 paths.
* path.cc (chdir): Replace check for FH_CYGDRIVE with more generic
isvirtual_dev macro.  Force setting of posix path for virtual fhandlers.
* path.h: Add externally visible path_prefix_p and normalized_posix_path
prototypes.
This commit is contained in:
Christopher Faylor
2002-05-02 04:13:48 +00:00
parent e1377e380f
commit 291be3076b
11 changed files with 240 additions and 64 deletions

View File

@@ -39,8 +39,6 @@ details. */
#include "shared_info.h"
#include "cygheap.h"
extern int normalize_posix_path (const char *, char *);
SYSTEM_INFO system_info;
/* Close all files and process any queued deletions.
@@ -2207,7 +2205,7 @@ extern "C" int
chroot (const char *newroot)
{
sigframe thisframe (mainthread);
path_conv path (newroot, PC_SYM_FOLLOW | PC_FULL);
path_conv path (newroot, PC_SYM_FOLLOW | PC_FULL | PC_POSIX);
int ret;
if (path.error)
@@ -2224,9 +2222,7 @@ chroot (const char *newroot)
}
else
{
char buf[MAX_PATH];
normalize_posix_path (newroot, buf);
cygheap->root.set (buf, path);
cygheap->root.set (path.normalized_path, path);
ret = 0;
}