aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2003-03-16 23:38:19 +0000
committerChristopher Faylor <me@cgf.cx>2003-03-16 23:38:19 +0000
commit98ed09b454dc07424803f5587da3b16abaf61fa7 (patch)
treef8a53048e332dfc6a2d65daa56236d6693518001
parentef208c4ecde5b0e4ac92ac3dd091a0a3edb5230d (diff)
downloadnewlib-98ed09b454dc07424803f5587da3b16abaf61fa7.zip
newlib-98ed09b454dc07424803f5587da3b16abaf61fa7.tar.gz
newlib-98ed09b454dc07424803f5587da3b16abaf61fa7.tar.bz2
* fhandler_console.cc (fhandler_console::close): Correct check for current tty.github/unlabeled-1.106.2unlabeled-1.106.2
Add debugging output when console is freed. (set_console_state_for_spawn): Add debugging output. * fhandler_tty.cc (fhandler_tty_slave::open): Don't decrement console open flag when vforking. * sigproc.cc (sigproc_terminate): Fix debugging output. * spawn.cc (handle): Eliminate second argument. (spawn_guts): Reflect elimination of argument change to handle. * syscalls.cc (setsid): Add debugging output when console is freed.
-rw-r--r--winsup/cygwin/fhandler_console.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc
index 647f145..bc27f95 100644
--- a/winsup/cygwin/fhandler_console.cc
+++ b/winsup/cygwin/fhandler_console.cc
@@ -166,6 +166,7 @@ set_console_state_for_spawn ()
&sec_none_nih, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,
NULL);
+ debug_printf ("h %p", h);
if (h == INVALID_HANDLE_VALUE)
return 0;
@@ -648,8 +649,12 @@ fhandler_console::close (void)
set_io_handle (NULL);
set_output_handle (NULL);
if (!cygheap->fdtab.in_vfork_cleanup () && --open_fhs <= 0
- && myself->ctty != FH_CONSOLE)
- FreeConsole ();
+ && myself->ctty != TTY_CONSOLE)
+ {
+ syscall_printf ("open_fhs %d, freeing console %p",
+ fhandler_console::open_fhs, myself->ctty);
+ FreeConsole ();
+ }
debug_printf ("decremented open_fhs, now %d", open_fhs);
return 0;
}