"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
"Todd C. Miller" <millert@openbsd.org>
Subject:
Re: -portable gotd progress
To:
Stefan Sperling <stsp@stsp.name>
Cc:
gameoftrees@openbsd.org
Date:
Sun, 20 Aug 2023 09:14:43 -0600

Download raw body.

Thread
On Sun, 20 Aug 2023 16:35:35 +0200, Stefan Sperling wrote:

> gotsh was indeed relying on OpenBSD-specific poll behaviour, assuming
> that POLLOUT and POLLHUP were mutually exclusive. Which is not the
> case on Linux where POLLOUT and POLLHUP can appear together.
> The order of relevant "revent" checks in our pollfd.c code would result
> in an endless polling loop, because we are checking the POLLOUT bit
> before checking the POLLHUP bit.

That is not OpenBSD-specific poll behaviour, it is what the POSIX
standard requires.  I'm surprised Linux is violating this.
https://pubs.opengroup.org/onlinepubs/9699919799/functions/poll.html

> I have fixed this issue on the main branch of got.git.
> The patch is trivial, see below.

Passing POLLOUT when you want to check for EOF does seem odd
so this does seem like an improvement.

 - todd