From e97377932b06f0993df95c7c7877474ec20ff74d Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sat, 27 Dec 2003 17:41:17 +0000 Subject: * 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. --- winsup/cygwin/fhandler.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'winsup/cygwin/fhandler.h') diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h index 5cbf387da..a064e24b0 100644 --- a/winsup/cygwin/fhandler.h +++ b/winsup/cygwin/fhandler.h @@ -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)]; -- cgit v1.2.3