bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#54245: 29.0.50; select usage in GNUstep


From: Po Lu
Subject: bug#54245: 29.0.50; select usage in GNUstep
Date: Sat, 05 Mar 2022 08:45:03 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux)

Robert Pluim <rpluim@gmail.com> writes:

> Iʼve been running with the following for a whole two days with no ill
> effects (and the resulting emacs binary does not contain any calls to
> 'select'). Last time I looked, emacs never seems to use the sigmask
> parameter to 'pselect' anyway, so itʼs kind of a moot point.
>
> diff --git a/src/nsterm.m b/src/nsterm.m
> index 670f8971df..4eb32de654 100644
> --- a/src/nsterm.m
> +++ b/src/nsterm.m
> @@ -5830,7 +5830,7 @@ - (void)fd_handler:(id)unused
>            fd_set fds;
>            FD_ZERO (&fds);
>            FD_SET (selfds[0], &fds);
> -          result = select (selfds[0]+1, &fds, NULL, NULL, NULL);
> +          result = pselect (selfds[0]+1, &fds, NULL, NULL, NULL, NULL);
>            if (result > 0 && read (selfds[0], &c, 1) == 1 && c == 'g')
>           waiting = 0;
>          }
>
> Robert

That LGTM, but I only tested on GNUstep.  The same code is also used on
macOS, so there might be some side effects.

Though the NS port is very old and I get the feeling that we keep
bumping into relics from over two decades ago, and using `select' might
very well be one of those.

Thanks.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]