aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2003-03-03 03:58:10 +0000
committerChristopher Faylor <me@cgf.cx>2003-03-03 03:58:10 +0000
commitd5d2ffee3870e18bc30cdc0653c525108ce444c1 (patch)
tree9cdd4f0888a002964d0591deda8f2d39c5897963
parentf5eb407ed17211ebc63abf2aba51d0f9106888f6 (diff)
downloadnewlib-d5d2ffee3870e18bc30cdc0653c525108ce444c1.zip
newlib-d5d2ffee3870e18bc30cdc0653c525108ce444c1.tar.gz
newlib-d5d2ffee3870e18bc30cdc0653c525108ce444c1.tar.bz2
* fhandler_console.cc (fhandler_console::close): Don't decrement in use counter
if in vfork fixup stage.
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/fhandler_console.cc3
2 files changed, 7 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index f81173f..f1afd94 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,10 @@
2003-03-02 Christopher Faylor <cgf@redhat.com>
+ * fhandler_console.cc (fhandler_console::close): Don't decrement
+ in use counter if in vfork fixup stage.
+
+2003-03-02 Christopher Faylor <cgf@redhat.com>
+
* lib/getopt.c: Nuke use of unneeded BSDisms.
2003-03-02 Christopher Faylor <cgf@redhat.com>
diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc
index 34c1c0d..647f145 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;