diff options
author | Christopher Faylor <me@cgf.cx> | 2004-01-15 00:49:24 +0300 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2004-01-15 00:49:24 +0300 |
commit | 3079a0f31e08c87c383728aeafae3b29f7f1e557 (patch) | |
tree | f96afbcd685ea7f6530a8e4c1783e952dd0ecd9d | |
parent | 3eb090aec281d1c4e342b779e11476d65b892031 (diff) |
* fhandler_console.cc (fhandler_console::close): Fix debugging output.
(fhandler_console::fixup_after_fork): Decrement open_fhs prior to call to
fhandler_console::open since this would cause incrementing too much
incrementing in child processes. (Probably needs to be handled more elegantly
someday)
(fhandler_console::fixup_after_exec): Ditto.
-rw-r--r-- | winsup/cygwin/ChangeLog | 9 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_console.cc | 5 |
2 files changed, 12 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index b52a26b8c..f1e3f2f0d 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,14 @@ 2004-01-14 Christopher Faylor <cgf@redhat.com> + * fhandler_console.cc (fhandler_console::close): Fix debugging output. + (fhandler_console::fixup_after_fork): Decrement open_fhs prior to call + to fhandler_console::open since this would cause incrementing too much + incrementing in child processes. (Probably needs to be handled more + elegantly someday) + (fhandler_console::fixup_after_exec): Ditto. + +2004-01-14 Christopher Faylor <cgf@redhat.com> + * cygtls.h (_threadinfo::call): Remove regparm declaration to work around compiler bug. diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index 86c02009a..af825defb 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -680,8 +680,7 @@ fhandler_console::close (void) if (!cygheap->fdtab.in_vfork_cleanup () && --(cygheap->open_fhs) <= 0 && myself->ctty != TTY_CONSOLE) { - syscall_printf ("open_fhs %d, freeing console %p", cygheap->open_fhs, - myself->ctty); + syscall_printf ("open_fhs %d", cygheap->open_fhs); FreeConsole (); } debug_printf ("decremented open_fhs, now %d", cygheap->open_fhs); @@ -1761,6 +1760,7 @@ fhandler_console::fixup_after_fork (HANDLE) /* Windows does not allow duplication of console handles between processes so open the console explicitly. */ + cygheap->open_fhs--; /* The downside of storing this in cygheap. */ if (!open (O_NOCTTY | get_flags (), 0)) system_printf ("error opening console after fork, %E"); @@ -1791,6 +1791,7 @@ fhandler_console::fixup_after_exec (HANDLE) HANDLE h = get_handle (); HANDLE oh = get_output_handle (); + cygheap->open_fhs--; /* The downside of storing this in cygheap. */ if (!open (O_NOCTTY | get_flags (), 0)) { int sawerr = 0; |