From: Thomas Huth <thuth@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Cc: amit.shah@redhat.com
Subject: Re: [Qemu-devel] [PATCH] qemu-char: handle EINTR for TCP character devices
Date: Tue, 21 Jul 2015 10:51:43 +0200 [thread overview]
Message-ID: <55AE081F.4060702@redhat.com> (raw)
In-Reply-To: <1437464069-27508-1-git-send-email-pbonzini@redhat.com>
On 21/07/15 09:34, Paolo Bonzini wrote:
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> qemu-char.c | 13 +++++++++++--
> 1 file changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/qemu-char.c b/qemu-char.c
> index b2b43c5..d956f8d 100644
> --- a/qemu-char.c
> +++ b/qemu-char.c
> @@ -2798,7 +2798,10 @@ static ssize_t tcp_chr_recv(CharDriverState *chr, char *buf, size_t len)
> #ifdef MSG_CMSG_CLOEXEC
> flags |= MSG_CMSG_CLOEXEC;
> #endif
> - ret = recvmsg(s->fd, &msg, flags);
> + do {
> + ret = recvmsg(s->fd, &msg, flags);
> + } while (ret == -1 && errno == EINTR);
> +
> if (ret > 0 && s->is_unix) {
> unix_process_msgfd(chr, &msg);
> }
I think you could also use the TFR() macro from include/qemu-common.h
here instead (TFR = temp. failure retry, I think)
Thomas
next prev parent reply other threads:[~2015-07-21 8:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-21 7:34 [Qemu-devel] [PATCH] qemu-char: handle EINTR for TCP character devices Paolo Bonzini
2015-07-21 8:10 ` Peter Maydell
2015-07-21 8:16 ` Paolo Bonzini
2015-07-21 8:36 ` Amit Shah
2015-07-21 8:45 ` Nils Carlson
2015-07-21 8:51 ` Thomas Huth [this message]
2015-07-21 8:55 ` Paolo Bonzini
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=55AE081F.4060702@redhat.com \
--to=thuth@redhat.com \
--cc=amit.shah@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.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).