GNU bug report logs -
#54245
29.0.50; select usage in GNUstep
Previous Next
Reported by: Lars Ingebrigtsen <larsi <at> gnus.org>
Date: Fri, 4 Mar 2022 15:31:01 UTC
Severity: minor
Tags: moreinfo
Found in version 29.0.50
Fixed in version 29.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Robert Pluim <rpluim <at> 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.
This bug report was last modified 3 years and 80 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.