This is the mail archive of the cygwin-patches@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fw: dup tty error.


----- Original Message -----
From: "Chris January" <chris@atomice.net>
To: <cygwin-patches@cygwin.com>
Sent: Sunday, June 30, 2002 11:17 PM
Subject: Re: Fw: dup tty error.


> > >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.
> I did some testing and it seemed like looping on SetConsoleTitle was
> unnecessary. I believe the window is open at this point, but the title is
> set asynchronously, hence the loop to wait for the title to change.
Just to add, the way I have my cygwin.bat set up, the console window is
*always* open before I run bash, yet I still see the tty dup error without
this patch.

Chris



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]