This is the mail archive of the
cygwin-patches@cygwin.com
mailing list for the Cygwin project.
Re: Fw: dup tty error.
- From: Christopher Faylor <cgf at redhat dot com>
- To: cygwin-patches at cygwin dot com
- Date: Sun, 30 Jun 2002 13:13:19 -0400
- Subject: Re: Fw: dup tty error.
- References: <00c501c22036$2cfd0f20$0100a8c0@advent02>
- Reply-to: cygwin-patches at cygwin dot com
On Sun, Jun 30, 2002 at 02:00:57PM +0100, Chris January wrote:
>2002-06-30 Christopher January <chris@atomice.net>
>
> * tty.cc (tty_list::allocate_tty): retry FindWindow if it fails.
__small_sprintf (buf, "cygwin.find.console.%d", myself->pid);
SetConsoleTitle (buf);
- Sleep (40);
- console = FindWindow (NULL, buf);
+ for (int times = 0; times < 25 && console == NULL; times++)
+ {
+ Sleep (40);
+ console = FindWindow (NULL, buf);
+ }
SetConsoleTitle (oldtitle);
Sleep (40);
ReleaseMutex (title_mutex);
Is the SetConsoleTitle really succeeding when the window doesn't exist
yet? That seems really broken to me but I guess that not too surprising.
I'm just wondering if we should be looping on the SetConsoleTitle rather
than the FindWindow.
cgf