From: Michael Kerrisk <mtk.manpages-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
To: Andrew Klossner
<andrew-pwabbKueSRu4mpay0g/RMEEOCMrvLtNR@public.gmane.org>
Cc: linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: select_tut(2): error in example code
Date: Thu, 10 Jun 2010 06:10:55 +0200 [thread overview]
Message-ID: <AANLkTilMEFef1CF5uYpNBddPRDfwfiNyQK0UqaiD8Gq_@mail.gmail.com> (raw)
In-Reply-To: <201006081541.o58FfQTt015276-1qr3+Ib8l7hP+3OIzQSClA49vMN11MuG@public.gmane.org>
Hello Andrew,
On Tue, Jun 8, 2010 at 5:41 PM, Andrew Klossner
<andrew-pwabbKueSRu4mpay0g/RMEEOCMrvLtNR@public.gmane.org> wrote:
> The select_tut(2) EXAMPLE has a one-character bug:
>
> /* NB: read oob data before normal reads */
>
> if (fd1 > 0)
> if (FD_ISSET(fd1, &er)) {
> char c;
>
> r = recv(fd1, &c, 1, MSG_OOB);
> if (r < 1)
> SHUT_FD1;
> else
> send(fd2, &c, 1, MSG_OOB);
> }
> if (fd2 > 0)
> if (FD_ISSET(fd2, &er)) {
> char c;
>
> r = recv(fd2, &c, 1, MSG_OOB);
> if (r < 1)
> +-> SHUT_FD1;
> | else
> | send(fd1, &c, 1, MSG_OOB);
> | }
> |
> +-- should be SHUT_FD2;
Thanks. Fixed for man-pages-3.25.
Cheers,
Michael
--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Author of "The Linux Programming Interface" http://blog.man7.org/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2010-06-10 4:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-08 15:41 select_tut(2): error in example code Andrew Klossner
[not found] ` <201006081541.o58FfQTt015276-1qr3+Ib8l7hP+3OIzQSClA49vMN11MuG@public.gmane.org>
2010-06-10 4:10 ` Michael Kerrisk [this message]
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=AANLkTilMEFef1CF5uYpNBddPRDfwfiNyQK0UqaiD8Gq_@mail.gmail.com \
--to=mtk.manpages-gm/ye1e23mwn+bqq9rbeug@public.gmane.org \
--cc=andrew-pwabbKueSRu4mpay0g/RMEEOCMrvLtNR@public.gmane.org \
--cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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).