summaryrefslogtreecommitdiff
path: root/winsup/cygwin/dtable.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/dtable.cc')
-rw-r--r--winsup/cygwin/dtable.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc
index c8d80e09156..d943e166b49 100644
--- a/winsup/cygwin/dtable.cc
+++ b/winsup/cygwin/dtable.cc
@@ -758,9 +758,11 @@ dtable::vfork_parent_restore ()
cfree (deleteme);
unlock ();
- cygheap->ctty = ctty_on_hold; // revert
- if (cygheap->ctty)
- cygheap->ctty->close (); // Undo previous bump of this archetype
+ if (cygheap->ctty != ctty_on_hold)
+ {
+ cygheap->ctty = ctty_on_hold; // revert
+ cygheap->ctty->close (); // Undo previous bump of this archetype
+ }
cygheap->ctty_on_hold = NULL;
return;