[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] qemu-char: handle EINTR for TCP character devic
From: |
Thomas Huth |
Subject: |
Re: [Qemu-devel] [PATCH] qemu-char: handle EINTR for TCP character devices |
Date: |
Tue, 21 Jul 2015 10:51:43 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 |
On 21/07/15 09:34, Paolo Bonzini wrote:
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
> 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