* fhandler.h (fhandler_tty_slave::archetype): Make public.

(report_tty_counts): New macro.  Use throughout for reporting tty use counts.
* dtable.cc (dtable::vfork_child_dup): Add debugging output for usecount
increment.  Increment open_fhs if appropriate.
(dtable::vfork_parent_restore): "Close" artificially bumped ctty.
(dtable::vfork_child_fixup): Close ctty since it was bumped prior to vfork.
Save open_fhs around close since the closing of these handles has no effect on
the console.
* fhandler_tty.cc (fhandler_tty_slave::open): Reorganize calls to allow for
easier tracking of usecount modification.
(fhandler_tty_slave::open): Ditto.
This commit is contained in:
Christopher Faylor
2003-12-27 17:41:17 +00:00
parent fe861ce934
commit e97377932b
6 changed files with 47 additions and 16 deletions

View File

@ -122,9 +122,9 @@ class fhandler_base
DWORD fs_flags;
HANDLE read_state;
path_conv pc;
class fhandler_base *archetype;
public:
class fhandler_base *archetype;
int usecount;
void set_name (path_conv &pc);
@ -1194,6 +1194,12 @@ struct fhandler_nodevice: public fhandler_base
// int __stdcall fstat (struct __stat64 *buf, path_conv *);
};
#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,\
use_op, ((fhandler_tty_slave *) fh)->archetype->usecount);
typedef union
{
char __base[sizeof (fhandler_base)];