From d5d2ffee3870e18bc30cdc0653c525108ce444c1 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Mon, 3 Mar 2003 03:58:10 +0000 Subject: [PATCH] * fhandler_console.cc (fhandler_console::close): Don't decrement in use counter if in vfork fixup stage. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/fhandler_console.cc | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index f81173f33..f1afd9453 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2003-03-02 Christopher Faylor + + * fhandler_console.cc (fhandler_console::close): Don't decrement + in use counter if in vfork fixup stage. + 2003-03-02 Christopher Faylor * lib/getopt.c: Nuke use of unneeded BSDisms. diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index 34c1c0da9..647f14585 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -647,7 +647,8 @@ fhandler_console::close (void) CloseHandle (get_output_handle ()); set_io_handle (NULL); set_output_handle (NULL); - if (--open_fhs <= 0 && myself->ctty != FH_CONSOLE) + if (!cygheap->fdtab.in_vfork_cleanup () && --open_fhs <= 0 + && myself->ctty != FH_CONSOLE) FreeConsole (); debug_printf ("decremented open_fhs, now %d", open_fhs); return 0;