diff options
author | Corinna Vinschen <vinschen@redhat.com> | 2006-12-18 21:59:08 +0000 |
---|---|---|
committer | Corinna Vinschen <vinschen@redhat.com> | 2006-12-18 21:59:08 +0000 |
commit | 72c13c2b62ce0ffd71ae40eefbd5ed838a47265c (patch) | |
tree | ff156564911886488f54b3bfec901afdfed5eca2 | |
parent | 97fb3ca8a10bfc1ad4730c4be4f2bf0735e26bce (diff) | |
download | gdb-72c13c2b62ce0ffd71ae40eefbd5ed838a47265c.tar.gz |
* pinfo.cc (set_myself): Use a more foolproof method for determining if
the current process was started from another cygiwn process.
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/pinfo.cc | 14 |
2 files changed, 7 insertions, 12 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 127526dae0c..be058c8c965 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2006-12-18 Christopher Faylor <me@cgf.cx> + + * pinfo.cc (set_myself): Use a more foolproof method for determining if + the current process was started from another cygiwn process. + 2006-12-05 Corinna Vinschen <corinna@vinschen.de> * dcrt0.cc (get_cygwin_startup_info): Fix comment. diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc index d73ad20aa8a..5ec63be8c3a 100644 --- a/winsup/cygwin/pinfo.cc +++ b/winsup/cygwin/pinfo.cc @@ -64,7 +64,8 @@ set_myself (HANDLE h) myself->exec_sendsig = NULL; myself->exec_dwProcessId = 0; } - else if (!myself->wr_proc_pipe) + else if (!child_proc_info) /* child_proc_info is only set when this process + was started by another cygwin process */ myself->start_time = time (NULL); /* Register our starting time. */ else if (cygheap->pid_handle) { @@ -123,16 +124,6 @@ pinfo::maybe_set_exit_code_from_windows () } void -pinfo::zap_cwd () -{ - 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. */ - SetCurrentDirectory (windows_system_directory); -} - -void pinfo::exit (DWORD n) { minimal_printf ("winpid %d, exit %d", GetCurrentProcessId (), n); @@ -148,7 +139,6 @@ pinfo::exit (DWORD n) } sigproc_terminate (ES_FINAL); - zap_cwd (); /* FIXME: There is a potential race between an execed process and its parent here. I hated to add a mutex just for that, though. */ |