From 3c788ea42a53e023a10216be0874d5193e11abc0 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 5 Dec 2006 21:46:26 +0000 Subject: [PATCH] * path.cc (cwdstuff::init): Don't change to windows_system_directory if Cygwin DLL has been loaded dynamically. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/path.cc | 12 ++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index b1f5b1cee..1c27b8cf5 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2006-12-05 Corinna Vinschen + + * path.cc (cwdstuff::init): Don't change to windows_system_directory + if Cygwin DLL has been loaded dynamically. + 2006-12-05 Corinna Vinschen * path.cc (cwdstuff::set): Don't try to open directory on systems not diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 9d1cb730e..b415a30dc 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -4154,12 +4154,16 @@ cwdstuff::get_hash () void cwdstuff::init () { + extern int dynamically_loaded; cwd_lock.init ("cwd_lock"); get_initial (); - /* Actually chdir into the syste dir to avoid cwd problems. See comment - in cwdstuff::set below. */ - extern char windows_system_directory[]; - SetCurrentDirectory (windows_system_directory); + if (!dynamically_loaded) + { + /* Actually chdir into the syste dir to avoid cwd problems. See comment + in cwdstuff::set below. */ + extern char windows_system_directory[]; + SetCurrentDirectory (windows_system_directory); + } cwd_lock.release (); }