* fhandler.h (fhandler_console::fixup_after_fork_exec): Declare new function.

(fhandler_console::fixup_after_fork): Use fixup_after_fork_exec.
(fhandler_console::fixup_after_exec): Ditto.
* fhandler_console.cc (fhandler_console::fixup_after_fork): Delete definition.
(fhandler_console::fixup_after_fork_exec): Rename from fixup_after_exec.
* pinfo.cc (_pinfo::set_ctty): Don't play with console count here.
* syscalls.cc (close_all_files): Don't close cygheap ctty if hExeced since the
child will be copying information from us.
(setsid): Use myctty() rather than raw ctty #.
This commit is contained in:
Christopher Faylor
2005-11-14 05:36:16 +00:00
parent 59297e0464
commit 5a0826c3f8
6 changed files with 24 additions and 40 deletions

View File

@@ -114,7 +114,7 @@ close_all_files (bool norelease)
cygheap->fdtab.release (i);
}
if (cygheap->ctty)
if (!hExeced && cygheap->ctty)
cygheap->close_ctty ();
cygheap->fdtab.unlock ();
@@ -347,8 +347,7 @@ setsid (void)
myself->pgid = getpid ();
if (cygheap->ctty)
cygheap->close_ctty ();
syscall_printf ("sid %d, pgid %d, ctty %d", myself->sid, myself->pgid,
myself->ctty);
syscall_printf ("sid %d, pgid %d, %s", myself->sid, myself->pgid, myctty ());
return myself->sid;
}