From: Alejandro Colomar <alx.manpages@gmail.com>
To: Enke Chen <enchen@paloaltonetworks.com>, linux-man@vger.kernel.org
Subject: Re: [patch] poll.2: tfix
Date: Wed, 5 Apr 2023 03:40:44 +0200 [thread overview]
Message-ID: <d3bc8e72-bac4-7d10-785d-93e4ad9ad248@gmail.com> (raw)
In-Reply-To: <CANJ8pZ_g0Bq+9AH6iVjm_xJr3o5TEuhkEA0qRi4JNteUB+jfrQ@mail.gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 1044 bytes --]
Hello Enke,
On 4/4/23 03:40, Enke Chen wrote:
> diff --git a/man2/poll.2 b/man2/poll.2
> index 4e26e62d4..5d2fa622d 100644
> --- a/man2/poll.2
> +++ b/man2/poll.2
> @@ -604,7 +604,7 @@ main(int argc, char *argv[])
>
> /* Deal with array returned by poll(). */
>
> - for (nfds_t j = 0; j < nfds; j++) {
> + for (nfds_t j = 0; j < ready; j++) {
This is not correct. The array is of size nfds. ready is
just the number of entries in the array that have been changed,
but there's no information about the order in which they'll
appear.
If you compile the program with the current code, you'll be
able to verify that it works. But with this patch, I believe
it will stop working.
Thanks,
Alex
> if (pfds[j].revents != 0) {
> printf(" fd=%d; events: %s%s%s\en", pfds[j].fd,
> (pfds[j].revents & POLLIN) ? "POLLIN " : "",
>
--
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next parent reply other threads:[~2023-04-05 1:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CANJ8pZ_g0Bq+9AH6iVjm_xJr3o5TEuhkEA0qRi4JNteUB+jfrQ@mail.gmail.com>
2023-04-05 1:40 ` Alejandro Colomar [this message]
2022-08-08 15:07 [PATCH] poll.2: tfix Štěpán Němec
2022-08-15 21:28 ` Alejandro Colomar
-- strict thread matches above, loose matches on Subject: below --
2012-05-10 5:59 David Prévot
[not found] ` <1336629593-10300-1-git-send-email-taffit-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org>
2012-05-10 6:08 ` Michael Kerrisk (man-pages)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d3bc8e72-bac4-7d10-785d-93e4ad9ad248@gmail.com \
--to=alx.manpages@gmail.com \
--cc=enchen@paloaltonetworks.com \
--cc=linux-man@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).