From 7e24f1bf3a75f4579cd6b39c87a9f1fb6e79d988 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Tue, 5 Sep 2000 03:16:28 +0000 Subject: * path.cc (cwd_win32): Eliminate. (cwd_posix): Eliminate. (cwd_hash): Eliminate. (cwdstuff::init): Rename from cwd_init. (cwdstuff::fixup_after_exec): Rename from cwd_fixup_after_exec. (cwdstuff::get): Rename from get_cwd_inner. (normalize_posix_path): Eliminate cwd argument. Just calculate when necessary. (normalize_win32_path): Ditto. (mount_info::conv_to_win32_path): Eliminate cwd retrieval here. (mount_info::conv_to_posix_path): Ditto. (hash_path_name): Accomodate additional methods in cwdstuff. (get_cwd_win32): Eliminate. (getcwd): Use cwdstuff methods. Properly handle case where buf == NULL and len < 0. (cwdstuff::get_hash): New method. (cwdstuff::get_initial): New method. (cwdstuff::set): New method. (cwdstuff::get): New method. (cwdstuff::copy): New method. * path.h: Move cwdstuff struct here. Add a bunch of stuff to cwdstuff. Make cygcwd an extern. * spawn.cc (spawn_guts): Use copy method to get copies of cwd info to pass to execed process. * dcrt0.cc (dll_crt0_1): Use cygcwd methods for cwd initialization. --- winsup/cygwin/spawn.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'winsup/cygwin/spawn.cc') diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc index 39e2b391a..82ee7fa0a 100644 --- a/winsup/cygwin/spawn.cc +++ b/winsup/cygwin/spawn.cc @@ -505,10 +505,8 @@ spawn_guts (HANDLE hToken, const char * prog_arg, const char *const *argv, ciresrv.moreinfo->argc = newargv.argc; ciresrv.moreinfo->argv = newargv; - /* FIXME: Should lock cwd access here. */ - ciresrv.moreinfo->cwd_posix = cwd_posix (NULL); - ciresrv.moreinfo->cwd_win32 = cwd_win32 (NULL); - ciresrv.moreinfo->cwd_hash = cwd_hash (); + cygcwd.copy (ciresrv.moreinfo->cwd_posix, ciresrv.moreinfo->cwd_win32, + ciresrv.moreinfo->cwd_hash); ciresrv.moreinfo->environ = (char **) cmalloc (HEAP_ARGV, envsize (envp, 1)); char **c; -- cgit v1.2.3