* fhandler.h (fhandler_console): Remove tcsetpgrp.

* fhandler_console.cc (fhandler_console::tcsetpgrp): Eliminate.
* fork.cc (fork_parent): Avoid returning same pid twice in a row regardless of
OS.
* pinfo.cc (pinfo::init): Rename create argument to flags and treat it as such.
* signal.cc (set_sigcatchers): New function.
(signal): Use set_sigcatchers to increment or decrement sigcatcher tracker.
(sigaction): Ditto.  Add debugging output.
* spawn.cc (spawn_guts): Always quote first argv[0] argument when it's a
COMSPEC shell.
This commit is contained in:
Christopher Faylor
2000-10-21 04:53:49 +00:00
parent e9921bcbaa
commit b0de2aa284
8 changed files with 57 additions and 36 deletions

View File

@ -443,14 +443,17 @@ fork_parent (void *stack_here, HANDLE& hParent, dll *&first_dll, bool& load_dlls
/* Protect the handle but name it similarly to the way it will
be called in subproc handling. */
ProtectHandle1 (pi.hProcess, childhProc);
if (os_being_run != winNT)
{
if (last_fork_proc)
CloseHandle (last_fork_proc);
if (!DuplicateHandle (hMainProc, pi.hProcess, hMainProc, &last_fork_proc,
0, FALSE, DUPLICATE_SAME_ACCESS))
system_printf ("couldn't create last_fork_proc, %E");
}
/* Keep a handle to the current forked process sitting around to prevent
Windows from reusing the same pid twice in a row. Having the same pid
twice in a row confuses bash. So, after every CreateProcess, we can safely
remove the old pid and save a handle to the newly created process. Keeping
a handle open will stop windows from reusing the same pid. */
if (last_fork_proc)
CloseHandle (last_fork_proc);
if (!DuplicateHandle (hMainProc, pi.hProcess, hMainProc, &last_fork_proc,
0, FALSE, DUPLICATE_SAME_ACCESS))
system_printf ("couldn't create last_fork_proc, %E");
/* Fill in fields in the child's process table entry. */
forked->ppid = myself->pid;