qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [Qemu-devel] [PATCH 1/2] osdep: Introduce qemu_dup


From: Eric Blake
Subject: Re: [Qemu-block] [Qemu-devel] [PATCH 1/2] osdep: Introduce qemu_dup
Date: Wed, 22 Jun 2016 09:18:12 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 06/22/2016 02:02 AM, Fam Zheng wrote:
> And use it in qemu_dup_flags.
> 
> Signed-off-by: Fam Zheng <address@hidden>
> ---
>  include/qemu/osdep.h |  3 +++
>  util/osdep.c         | 23 +++++++++++++++--------
>  2 files changed, 18 insertions(+), 8 deletions(-)

> +int qemu_dup(int fd)
> +{
> +    int r;
> +#ifdef F_DUPFD_CLOEXEC
> +    r = fcntl(fd, F_DUPFD_CLOEXEC, 0);
> +#else
> +    r = dup(fd);
> +    if (r != -1) {
> +        qemu_set_cloexec(raw_s->fd);

Uhh, don't you mean s/raw_s->fd/r/ ?

> +    }
> +#endif
> +    return r;
> +}
> +
>  static int qemu_parse_fdset(const char *param)
>  {
>      return qemu_parse_fd(param);
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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