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.
This commit is contained in:
Christopher Faylor
2003-12-30 01:57:16 +00:00
parent e97377932b
commit 8ed5c9b629
11 changed files with 77 additions and 49 deletions

View File

@@ -829,8 +829,6 @@ class fhandler_console: public fhandler_termios
void set_cursor_maybe ();
public:
static int open_fhs;
fhandler_console ();
fhandler_console* is_console () { return this; }
@@ -1197,7 +1195,7 @@ struct fhandler_nodevice: public fhandler_base
#define report_tty_counts(fh, call, fhs_op, use_op) \
termios_printf ("%s %s, %sopen_fhs %d, %susecount %d",\
fh->ttyname (), call,\
fhs_op, fhandler_console::open_fhs,\
fhs_op, cygheap->open_fhs,\
use_op, ((fhandler_tty_slave *) fh)->archetype->usecount);
typedef union