From c75e4f09ec9ba7349554ed434777994e51ead740 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sat, 22 Jan 2005 21:47:04 +0000 Subject: * spawn.cc (spawn_guts): Perform same "cd" as in pinfo::exit below to make sure that a stub process does not keep the current working directory busy after the "execed" process has exited. --- winsup/cygwin/spawn.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'winsup/cygwin/spawn.cc') diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc index 0c26ab23d..68a49f4fe 100644 --- a/winsup/cygwin/spawn.cc +++ b/winsup/cygwin/spawn.cc @@ -809,9 +809,14 @@ spawn_guts (const char * prog_arg, const char *const *argv, dup_proc_pipe essentially a no-op. */ if (myself->wr_proc_pipe) { - /* Make sure that we own wr_proc_pipe just in case we've been - previously execed. */ - myself->sync_proc_pipe (); + 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. */ (void) myself->dup_proc_pipe (pi.hProcess); } } -- cgit v1.2.3