summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fhandler_tty.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2005-11-17 16:17:17 +0000
committerCorinna Vinschen <corinna@vinschen.de>2005-11-17 16:17:17 +0000
commit0f46c31745740b8538ce30944182f425ef4f0142 (patch)
tree8ee34abf7a55241520f515a7302a94a58d62f4a4 /winsup/cygwin/fhandler_tty.cc
parentd55950ba3a50f0db3f5ec12d1586a132b454ffc6 (diff)
downloadcygnal-0f46c31745740b8538ce30944182f425ef4f0142.tar.gz
cygnal-0f46c31745740b8538ce30944182f425ef4f0142.tar.bz2
cygnal-0f46c31745740b8538ce30944182f425ef4f0142.zip
* fhandler_tty.cc (fhandler_tty_slave::open): Don't expect that
service applications have no window station attached.
Diffstat (limited to 'winsup/cygwin/fhandler_tty.cc')
-rw-r--r--winsup/cygwin/fhandler_tty.cc17
1 files changed, 10 insertions, 7 deletions
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index 3bf524e11..559819fee 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -577,15 +577,18 @@ fhandler_tty_slave::open (int flags, mode_t)
set_open_status ();
if (cygheap->manage_console_count ("fhandler_tty_slave::open", 1) == 1
&& !GetConsoleCP () && !output_done_event
- && wincap.pty_needs_alloc_console () && !GetProcessWindowStation ())
+ && wincap.pty_needs_alloc_console ())
{
BOOL b;
- HWINSTA h = CreateWindowStation (NULL, 0, GENERIC_READ | GENERIC_WRITE, &sec_none_nih);
- termios_printf ("CreateWindowStation %p, %E", h);
- if (h)
- {
- b = SetProcessWindowStation (h);
- termios_printf ("SetProcessWindowStation %d, %E", b);
+ if (!GetProcessWindowStation ())
+ {
+ HWINSTA h = CreateWindowStation (NULL, 0, GENERIC_READ | GENERIC_WRITE, &sec_none_nih);
+ termios_printf ("CreateWindowStation %p, %E", h);
+ if (h)
+ {
+ b = SetProcessWindowStation (h);
+ termios_printf ("SetProcessWindowStation %d, %E", b);
+ }
}
b = AllocConsole (); // will cause flashing if workstation
// stuff fails