qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/3] chardev: On QIO_CHANNEL_ERR_BROKEN set errn


From: Daniel P . Berrangé
Subject: Re: [Qemu-devel] [PATCH 2/3] chardev: On QIO_CHANNEL_ERR_BROKEN set errno to EPIPE
Date: Fri, 1 Jun 2018 12:51:05 +0100
User-agent: Mutt/1.9.5 (2018-04-13)

On Thu, May 31, 2018 at 09:46:00AM +0200, Sergio Lopez wrote:
> This allows callers to identify this potentially unrecoverable error.
> ---
>  chardev/char-io.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/chardev/char-io.c b/chardev/char-io.c
> index f810524..f934eb9 100644
> --- a/chardev/char-io.c
> +++ b/chardev/char-io.c
> @@ -168,6 +168,9 @@ int io_channel_send_full(QIOChannel *ioc,
>  
>              errno = EAGAIN;
>              return -1;
> +        } else if (ret == QIO_CHANNEL_ERR_BROKEN) {
> +            errno = EPIPE;
> +            return -1;
>          } else if (ret < 0) {
>              errno = EINVAL;
>              return -1;

Again, I don't see any reason to add this special case for EPIPE


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



reply via email to

[Prev in Thread] Current Thread [Next in Thread]