diff options
author | Christopher Faylor <me@cgf.cx> | 2002-08-30 16:03:52 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2002-08-30 16:03:52 +0000 |
commit | f80e156de95bbf723355cde3d9ba1d2a66eefef0 (patch) | |
tree | c38244f40cdc06dea9c729b78689f0358275643a /winsup/cygwin/tty.cc | |
parent | 91edb60487810ad14f6baea6140ff4ff2cc60f59 (diff) | |
download | cygnal-f80e156de95bbf723355cde3d9ba1d2a66eefef0.tar.gz cygnal-f80e156de95bbf723355cde3d9ba1d2a66eefef0.tar.bz2 cygnal-f80e156de95bbf723355cde3d9ba1d2a66eefef0.zip |
Christopher Faylor <cgf@redhat.com>
* tty.cc (tty_list::allocate_tty): Use GetConsoleWindow, if available. Call
FindWindow in a loop.
Diffstat (limited to 'winsup/cygwin/tty.cc')
-rw-r--r-- | winsup/cygwin/tty.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/winsup/cygwin/tty.cc b/winsup/cygwin/tty.cc index bb9f8409f..360fa2ef5 100644 --- a/winsup/cygwin/tty.cc +++ b/winsup/cygwin/tty.cc @@ -196,7 +196,7 @@ tty_list::allocate_tty (int with_console) if (!with_console) console = NULL; - else + else if (!(console = GetConsoleWindow ())) { char *oldtitle = new char [TITLESIZE]; @@ -218,8 +218,12 @@ tty_list::allocate_tty (int with_console) __small_sprintf (buf, "cygwin.find.console.%d", myself->pid); SetConsoleTitle (buf); - Sleep (40); - console = FindWindow (NULL, buf); + for (int times = 0; times < 25; times++) + { + Sleep (10); + if ((console = FindWindow (NULL, buf))) + break; + } SetConsoleTitle (oldtitle); Sleep (40); ReleaseMutex (title_mutex); |