summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/syscalls.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/syscalls.cc')
-rw-r--r--winsup/cygwin/syscalls.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index 2b2e97d85..ab8aeea00 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -335,7 +335,7 @@ setsid (void)
myself->pgid, myself->ctty, fhandler_console::open_fhs);
if (cygheap->ctty)
{
- if (!--cygheap->ctty->usecount)
+ if (cygheap->ctty->usecount == 1)
cygheap->ctty->close ();
cygheap->ctty = NULL;
}