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 <marcandre.lur...@redhat.com>
> ---

> +++ 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