Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2003-12-30 04:57:16 +0300
committerChristopher Faylor <me@cgf.cx>2003-12-30 04:57:16 +0300
commit8ed5c9b6297dce0115a462e6ae1a644a9a278bdb (patch)
tree473e2145a60c105c2375886d95fe3c675220af25 /winsup/cygwin/fhandler_console.cc
parente97377932b06f0993df95c7c7877474ec20ff74d (diff)
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/fhandler_console.cc')
-rw-r--r--winsup/cygwin/fhandler_console.cc18
1 files changed, 8 insertions, 10 deletions
diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc
index 46f1cb1a5..86c02009a 100644
--- a/winsup/cygwin/fhandler_console.cc
+++ b/winsup/cygwin/fhandler_console.cc
@@ -73,8 +73,6 @@ static console_state NO_COPY *shared_console_info;
dev_console NO_COPY *fhandler_console::dev_state;
-int NO_COPY fhandler_console::open_fhs;
-
/* Allocate and initialize the shared record for the current console.
Returns a pointer to shared_console_info. */
tty_min *
@@ -664,10 +662,10 @@ fhandler_console::open (int flags, mode_t)
TTYCLEARF (RSTCONS);
set_open_status ();
- open_fhs++;
- debug_printf ("incremented open_fhs, now %d", open_fhs);
- debug_printf ("opened conin$ %p, conout$ %p",
- get_io_handle (), get_output_handle ());
+ cygheap->open_fhs++;
+ debug_printf ("incremented open_fhs, now %d", cygheap->open_fhs);
+ debug_printf ("opened conin$ %p, conout$ %p", get_io_handle (),
+ get_output_handle ());
return 1;
}
@@ -679,14 +677,14 @@ fhandler_console::close (void)
CloseHandle (get_output_handle ());
set_io_handle (NULL);
set_output_handle (NULL);
- if (!cygheap->fdtab.in_vfork_cleanup () && --open_fhs <= 0
+ if (!cygheap->fdtab.in_vfork_cleanup () && --(cygheap->open_fhs) <= 0
&& myself->ctty != TTY_CONSOLE)
{
- syscall_printf ("open_fhs %d, freeing console %p",
- fhandler_console::open_fhs, myself->ctty);
+ syscall_printf ("open_fhs %d, freeing console %p", cygheap->open_fhs,
+ myself->ctty);
FreeConsole ();
}
- debug_printf ("decremented open_fhs, now %d", open_fhs);
+ debug_printf ("decremented open_fhs, now %d", cygheap->open_fhs);
return 0;
}