From: Christopher Faylor Date: Mon, 7 Feb 2005 05:28:49 +0000 (+0000) Subject: * exceptions.cc: Make windows_system_directory non-static. X-Git-Tag: binutils-2_16-branchpoint~99 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=bec2abd71e3a582cb2727f1246827ab4b2978415;p=newlib-cygwin.git * exceptions.cc: Make windows_system_directory non-static. * pinfo.cc (pinfo::exit): Change innocuous cd'ed location to one that is more likely to exist. --- diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index a612dfab3..a8bfcf7ff 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2005-02-07 Christopher Faylor + + * exceptions.cc: Make windows_system_directory non-static. + * pinfo.cc (pinfo::exit): Change innocuous cd'ed location to one that + is more likely to exist. + 2005-02-06 Corinna Vinschen * path.cc (path_conv::check): Leave symlink expansion loop in case diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index 2531e6cb8..838cbf32e 100644 --- a/winsup/cygwin/exceptions.cc +++ b/winsup/cygwin/exceptions.cc @@ -40,7 +40,7 @@ extern DWORD dwExeced; static BOOL WINAPI ctrl_c_handler (DWORD); static void signal_exit (int) __attribute__ ((noreturn)); -static char windows_system_directory[1024]; +char windows_system_directory[1024]; static size_t windows_system_directory_length; /* This is set to indicate that we have already exited. */ diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc index 7805eb43d..367ecd187 100644 --- a/winsup/cygwin/pinfo.cc +++ b/winsup/cygwin/pinfo.cc @@ -144,11 +144,11 @@ pinfo::exit (DWORD n) if (n != EXITCODE_NOSET) { - SetCurrentDirectory ("c:\\"); /* Move to an innocuous location to - avoid races with other processes - that may want to manipulate the - current directory before this process - has completely exited. */ + extern char windows_system_directory[]; + /* Move to an innocuous location to avoid a race with other processes + that may want to manipulate the current directory before this + process has completely exited. */ + (void) SetCurrentDirectory (windows_system_directory); self->alert_parent (0); /* Shave a little time by telling our parent that we have now exited. */ }