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 (); }