* child_info.h (child_status): Fix typo which made it impossible to set

iscygwin.
(child_info::isstraced): Booleanize.
(child_info::iscygwin): Ditto.
* sigproc.cc (child_info::child_info): Minor cleanup of flag setting.
* spawn.cc (spawn_guts): Only close_all_files when we know the process has
started successfully.
* exceptions.cc (init_console_handler): Fix indentation.
This commit is contained in:
Christopher Faylor
2006-03-22 03:20:28 +00:00
parent ce93dfe415
commit 76ef40d69f
5 changed files with 39 additions and 23 deletions

View File

@ -777,8 +777,6 @@ loop:
strace.execing = 1;
myself.hProcess = hExeced = pi.hProcess;
strcpy (myself->progname, real_path); // FIXME: race?
if (!looped)
close_all_files (true);
sigproc_printf ("new process name %s", myself->progname);
/* If wr_proc_pipe doesn't exist then this process was not started by a cygwin
process. So, we need to wait around until the process we've just "execed"
@ -864,19 +862,25 @@ loop:
myself->wr_proc_pipe_owner = GetCurrentProcessId ();
myself->wr_proc_pipe = orig_wr_proc_pipe;
}
if (ch.proc_retry (pi.hProcess) == 0)
DWORD res = ch.proc_retry (pi.hProcess);
if (!res)
{
looped++;
goto loop;
}
close_all_files (true);
}
else if (!myself->wr_proc_pipe
&& WaitForSingleObject (pi.hProcess, 0) == WAIT_TIMEOUT)
else
{
extern bool is_toplevel_proc;
is_toplevel_proc = true;
myself.remember (false);
waitpid (myself->pid, &res, 0);
close_all_files (true);
if (!myself->wr_proc_pipe
&& WaitForSingleObject (pi.hProcess, 0) == WAIT_TIMEOUT)
{
extern bool is_toplevel_proc;
is_toplevel_proc = true;
myself.remember (false);
waitpid (myself->pid, &res, 0);
}
}
myself.exit (EXITCODE_NOSET);
break;