qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v19 08/20] io: add qio_channel_readv_full_all_eof & qio_chann


From: Stefan Hajnoczi
Subject: Re: [PATCH v19 08/20] io: add qio_channel_readv_full_all_eof & qio_channel_readv_full_all helpers
Date: Thu, 14 Jan 2021 16:27:29 +0000

On Thu, Jan 14, 2021 at 10:40:03AM -0500, Jagannathan Raman wrote:
> +int qio_channel_readv_full_all(QIOChannel *ioc,
> +                               const struct iovec *iov,
> +                               size_t niov,
> +                               int **fds, size_t *nfds,
> +                               Error **errp)
>  {
> -    int ret = qio_channel_readv_all_eof(ioc, iov, niov, errp);
> +    int ret = qio_channel_readv_full_all_eof(ioc, iov, niov, fds, nfds, 
> errp);
>  
>      if (ret == 0) {
> -        ret = -1;
>          error_setg(errp,
>                     "Unexpected end-of-file before all bytes were read");

qio_channel_readv_full_all_eof() can read file descriptors but no data
and return 0.

Here that case is converted into an error and the file descriptors
aren't closed, freed, and fds/nfds isn't cleared.

Attachment: signature.asc
Description: PGP signature


reply via email to

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