summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/path.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2006-12-05 21:46:26 +0000
committerCorinna Vinschen <corinna@vinschen.de>2006-12-05 21:46:26 +0000
commit3c788ea42a53e023a10216be0874d5193e11abc0 (patch)
tree70fd97bac66597788df3b1b6b5f5fe7118cc1cc7 /winsup/cygwin/path.cc
parent2156546df22da60d1dfc49c76a638859d86a792d (diff)
downloadcygnal-3c788ea42a53e023a10216be0874d5193e11abc0.tar.gz
cygnal-3c788ea42a53e023a10216be0874d5193e11abc0.tar.bz2
cygnal-3c788ea42a53e023a10216be0874d5193e11abc0.zip
* path.cc (cwdstuff::init): Don't change to windows_system_directory
if Cygwin DLL has been loaded dynamically.
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 ();
}