summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/syscalls.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2003-12-30 01:57:16 +0000
committerChristopher Faylor <me@cgf.cx>2003-12-30 01:57:16 +0000
commit8ed5c9b6297dce0115a462e6ae1a644a9a278bdb (patch)
tree473e2145a60c105c2375886d95fe3c675220af25 /winsup/cygwin/syscalls.cc
parente97377932b06f0993df95c7c7877474ec20ff74d (diff)
downloadcygnal-8ed5c9b6297dce0115a462e6ae1a644a9a278bdb.tar.gz
cygnal-8ed5c9b6297dce0115a462e6ae1a644a9a278bdb.tar.bz2
cygnal-8ed5c9b6297dce0115a462e6ae1a644a9a278bdb.zip
Move open_fhs from fhandler.h to cygheap.h for easier tracking. Accommodate
this change throughout. * dtable.cc (dtable::add_archetype): Use correct count when iterating through *active* archetypes. * dtable.cc (dtable::fixup_after_exec): Close handle if close_on_exec and archetype exists since archetype currently does not set windows close-on-exec flag (FIXME). * fhandler_tty.cc (fhandler_tty_slave::open): Change debugging output slightly. (fhandler_tty_slave::close): Ditto. (fhandler_tty_slave::fixup_after_fork): Just report on inherited use counts since since archetype currently does not set windows close-on-exec flag (FIXME). * pinfo.cc (_pinfo::set_ctty): Change debugging output slightly. * cygheap.cc (cygheap_init): Remove open_fhs accommodation and use count reporting. * perthread.h (vfork_save::fhctty): New element. * perthread.h (vfork_save::open_fhs): New element. * fork.cc (vfork): Muck around with ctty and open_fhs stuff, both of which are now saved in the vfork_save structure.
Diffstat (limited to 'winsup/cygwin/syscalls.cc')
-rw-r--r--winsup/cygwin/syscalls.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index 8bf74d5ae..47d6b10de 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -104,6 +104,7 @@ close_all_files (void)
{
debug_printf ("closing ctty");
cygheap->ctty->close ();
+ cygheap->ctty = NULL;
}
ReleaseResourceLock (LOCK_FD_LIST, WRITE_LOCK | READ_LOCK, "close_all_files");
@@ -320,7 +321,7 @@ setsid (void)
syscall_printf ("hmm. pgid %d pid %d", myself->pgid, myself->pid);
else
{
- if (myself->ctty >= 0 && fhandler_console::open_fhs <= 0)
+ if (myself->ctty >= 0 && cygheap->open_fhs <= 0)
{
syscall_printf ("freeing console");
FreeConsole ();
@@ -329,7 +330,7 @@ setsid (void)
myself->sid = getpid ();
myself->pgid = getpid ();
syscall_printf ("sid %d, pgid %d, ctty %d, open_fhs %d", myself->sid,
- myself->pgid, myself->ctty, fhandler_console::open_fhs);
+ myself->pgid, myself->ctty, cygheap->open_fhs);
if (cygheap->ctty)
{
cygheap->ctty->close ();