From 335c87f94dc73e6d6dbe5d29d59a1c221373bcbc Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Fri, 3 May 2002 02:43:45 +0000 Subject: * fhandler_proc.cc (fhandler_proc::fstat): Use fhandler name rather than path_conv name. (fhandler_proc::open): Ditto. * fhandler_process.cc (fhandler_process::fstat): Use fhandler name rather than path_conv name. (fhandler_process::open): Ditto. * fhandler_registry.cc (fhandler_registry::fstat): Use fhandler name rather than path_conv name. (fhandler_registry::open): Ditto. * path.cc (path_conv::check): Don't copy posix path when virtual. (mount_info::conv_to_win32_path): Don't zero string when isproc. Just derive normal windows path. * path.h (path_conv::clear_normalized_path): Declare new method. * path.cc (path_conv::clear_normalized_path): Define new method. * dtable.cc (build_fhandler_from_name): Clear normalized path when finished to conserve space. --- winsup/cygwin/path.cc | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) (limited to 'winsup/cygwin/path.cc') diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 54451bce8..9299c0159 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -368,10 +368,20 @@ path_conv::update_fs_info (const char* win32_path) } } -path_conv::~path_conv () +void +path_conv::clear_normalized_path () { + // not thread safe if (normalized_path) - cfree (normalized_path); + { + cfree (normalized_path); + normalized_path = NULL; + } +} + +path_conv::~path_conv () +{ + clear_normalized_path (); } /* Convert an arbitrary path SRC to a pure Win32 path, suitable for @@ -526,8 +536,6 @@ path_conv::check (const char *src, unsigned opt, fileattr = 0; } delete fh; - if (!error) - strcpy (path, path_copy); goto out; } /* devn should not be a device. If it is, then stop parsing now. */ @@ -1428,7 +1436,13 @@ mount_info::conv_to_win32_path (const char *src_path, char *dst, /* Check if the cygdrive prefix was specified. If so, just strip off the prefix and transform it into an MS-DOS path. */ MALLOC_CHECK; - if (iscygdrive (pathbuf)) + if (isproc (pathbuf)) + { + devn = fhandler_proc::get_proc_fhandler (pathbuf); + if (devn == FH_BAD) + return ENOENT; + } + else if (iscygdrive (pathbuf)) { int n = mount_table->cygdrive_len - 1; if (!pathbuf[n] || @@ -1447,14 +1461,6 @@ mount_info::conv_to_win32_path (const char *src_path, char *dst, else if (mount_table->cygdrive_len > 1) return ENOENT; } - if (isproc (pathbuf)) - { - devn = fhandler_proc::get_proc_fhandler (pathbuf); - dst[0] = '\0'; - if (devn == FH_BAD) - return ENOENT; - goto out; - } int chrooted_path_len; chrooted_path_len = 0; -- cgit v1.2.3