* 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:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user