aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/fhandler.h
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2003-12-27 17:41:17 +0000
committerChristopher Faylor <me@cgf.cx>2003-12-27 17:41:17 +0000
commite97377932b06f0993df95c7c7877474ec20ff74d (patch)
treee06f5299ce91c509ac8a34d9aa13226e5206f5e3 /winsup/cygwin/fhandler.h
parentfe861ce9344d7577a909fc2878b2e61483bf6107 (diff)
downloadnewlib-e97377932b06f0993df95c7c7877474ec20ff74d.zip
newlib-e97377932b06f0993df95c7c7877474ec20ff74d.tar.gz
newlib-e97377932b06f0993df95c7c7877474ec20ff74d.tar.bz2
* 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.
Diffstat (limited to 'winsup/cygwin/fhandler.h')
-rw-r--r--winsup/cygwin/fhandler.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h
index 5cbf387..a064e24 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)];