Index | Thread | Search

From:
Martin Ziemer <horrad@horrad.de>
Subject:
Re: Ping: Possible unbreak for gnuchess 6.3.0
To:
Stuart Henderson <stu@spacehopper.org>
Cc:
ports@openbsd.org
Date:
Tue, 23 Sep 2025 12:22:35 +0200

Download raw body.

Thread
Am Mon, Sep 22, 2025 at 11:03:07PM +0100 schrieb Stuart Henderson:
> On 2025/09/22 09:37, Martin Ziemer wrote:
> > Am Fri, Sep 12, 2025 at 01:42:20PM +0200 schrieb Martin Ziemer:
> > > This patch is a possible solution for the build problems with input from
> > > /dev/null.
> > > 
> > > The patch changes the source from gnuchess by adding a global flag,
> > > which can disable the whole input routine by replacing it with some
> > > sleeps.
> > > 
> > > Tested on amd64 by building with make < /dev/null and with dpb 
> > > games/gnuchess. (And playing a game with the new package)
> > 
> > +@@ -140,6 +140,10 @@ void *input_func(void *arg __attribute__((unused)) )
> > +   char prompt[MAXSTR] = "";
> > + 
> > +   while (!(flags & QUIT)) {
> > ++    if(noinput) {
> > ++      usleep(100);
> > ++      continue;
> > ++    }
> > +     if (!(flags & XBOARD)) {
> > + 
> > +       pthread_mutex_lock( &input_mutex );
> 
> surely this can't really be a proper reliable fix?
I really thought, this could be a proper fix for this problem:
The continue just jumps over the input handling, which is not needed,
while the Book is imported. (But if the input loops ends, gnuchess
shuts down.)

The usleep is needed, because without it the loop would eat up CPU
cycles.