aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/fhandler_console.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/fhandler_console.cc')
-rw-r--r--winsup/cygwin/fhandler_console.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc
index 5b220f6..90edae6 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;