summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/dtable.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-05-02 04:13:48 +0000
committerChristopher Faylor <me@cgf.cx>2002-05-02 04:13:48 +0000
commit291be3076b91e2165b6c9aecf89d7e767afa89d7 (patch)
tree0da562f5dfc2f8f7e63bb335aff79ddd60429aca /winsup/cygwin/dtable.cc
parente1377e380f8dc4ee26802a3b15ce94ebf629c64c (diff)
downloadcygnal-291be3076b91e2165b6c9aecf89d7e767afa89d7.tar.gz
cygnal-291be3076b91e2165b6c9aecf89d7e767afa89d7.tar.bz2
cygnal-291be3076b91e2165b6c9aecf89d7e767afa89d7.zip
* 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.
Diffstat (limited to 'winsup/cygwin/dtable.cc')
-rw-r--r--winsup/cygwin/dtable.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc
index f70e41599..93d5602fd 100644
--- a/winsup/cygwin/dtable.cc
+++ b/winsup/cygwin/dtable.cc
@@ -280,14 +280,14 @@ fhandler_base *
dtable::build_fhandler_from_name (int fd, const char *name, HANDLE handle,
path_conv& pc, unsigned opt, suffix_info *si)
{
- pc.check (name, opt | PC_NULLEMPTY | PC_FULL, si);
+ pc.check (name, opt | PC_NULLEMPTY | PC_FULL | PC_POSIX, si);
if (pc.error)
{
set_errno (pc.error);
return NULL;
}
- return build_fhandler (fd, pc.get_devn (), name, pc, pc.get_unitn ());
+ return build_fhandler (fd, pc.get_devn (), pc.normalized_path, pc, pc.get_unitn ());
}
#define cnew(name) new ((void *) ccalloc (HEAP_FHANDLER, 1, sizeof (name))) name
@@ -363,6 +363,15 @@ dtable::build_fhandler (int fd, DWORD dev, const char *unix_name,
case FH_OSS_DSP:
fh = cnew (fhandler_dev_dsp) ();
break;
+ case FH_PROC:
+ fh = cnew (fhandler_proc) ();
+ break;
+ case FH_REGISTRY:
+ fh = cnew (fhandler_registry) ();
+ break;
+ case FH_PROCESS:
+ fh = cnew (fhandler_process) ();
+ break;
default:
system_printf ("internal error -- unknown device - %p", dev);
fh = NULL;