qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 09/27] slirp: replace qemu_set_nonblock()


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 09/27] slirp: replace qemu_set_nonblock()
Date: Thu, 17 Jan 2019 11:55:10 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0

On 1/17/19 5:43 AM, Marc-André Lureau wrote:
> Replace qemu_set_nonblock() with slirp_set_nonblock()
> 
> qemu_set_nonblock() does some event registration with the main
> loop. Add a new callback register_poll_fd() for that reason.
> 
> Always build the fd-register stub, to avoid #if WIN32.
> 
> Signed-off-by: Marc-André Lureau <address@hidden>
> ---

> +++ b/slirp/util.c
> @@ -43,6 +43,18 @@ int inet_aton(const char *cp, struct in_addr *ia)
>  }
>  #endif
>  
> +void slirp_set_nonblock(int fd)
> +{
> +#ifndef _WIN32
> +    int f;
> +    f = fcntl(fd, F_GETFL);
> +    fcntl(fd, F_SETFL, f | O_NONBLOCK);

No error checking?  Is that wise?

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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