summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/spawn.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2005-02-11 15:24:15 +0000
committerChristopher Faylor <me@cgf.cx>2005-02-11 15:24:15 +0000
commitcc9440b6f42536f9f3b3fca6a6c53155792a51eb (patch)
tree7839100d471d0478d72881287053dde865e70bb4 /winsup/cygwin/spawn.cc
parent199bf79367fd838d12900e70c05756f2bc29db5d (diff)
downloadcygnal-cc9440b6f42536f9f3b3fca6a6c53155792a51eb.tar.gz
cygnal-cc9440b6f42536f9f3b3fca6a6c53155792a51eb.tar.bz2
cygnal-cc9440b6f42536f9f3b3fca6a6c53155792a51eb.zip
* cygthread.cc (cygthread::release): Reset ev here if it exists.
(cygthread::terminate_thread): Eliminat racy code which reset ev and thread_sync. Remove a few nonsensical inuse checks. Exit at the bottom. (cygthread::detach): Rewrite to again try to ensure that we don't say we're signalled when we are not signalled. * fhandler.cc (fhandler_base::raw_read): Revert to signalling read success quickly. * pipe.cc (fhandler_pipe::close): Use base method to close handle. * sigproc.h (WAIT_SIG_PRIORITY): Just trundle along at normal priority to allow the pipe thread to do its thing if possible. * pinfo.h (pinfo::zap_cwd): Declare new function. (pinfo::zap_cwd): Move 'cd out of the way code' here. (pinfo::exit): Use it here. * spawn.cc (spawn_guts): And here.
Diffstat (limited to 'winsup/cygwin/spawn.cc')
-rw-r--r--winsup/cygwin/spawn.cc8
1 files changed, 2 insertions, 6 deletions
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc
index 1f30175da..b83a7dfe2 100644
--- a/winsup/cygwin/spawn.cc
+++ b/winsup/cygwin/spawn.cc
@@ -804,7 +804,7 @@ spawn_guts (const char * prog_arg, const char *const *argv,
If wr_proc_pipe exists, then it should be duplicated to the child.
If the child has exited already, that's ok. The parent will pick up
- on this fact when we exit. dup_proc_pipe also closes our end of the pipe.
+ on this fact when we exit. dup_proc_pipe will close our end of the pipe.
Note that wr_proc_pipe may also be == INVALID_HANDLE_VALUE. That will make
dup_proc_pipe essentially a no-op. */
if (myself->wr_proc_pipe)
@@ -812,11 +812,7 @@ spawn_guts (const char * prog_arg, const char *const *argv,
myself->sync_proc_pipe (); /* Make sure that we own wr_proc_pipe
just in case we've been previously
execed. */
- 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. */
+ myself.zap_cwd ();
(void) myself->dup_proc_pipe (pi.hProcess);
}
}