summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/path.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r--winsup/cygwin/path.cc12
1 files changed, 8 insertions, 4 deletions
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 ();
}