Hi

On Thu, Jan 17, 2019 at 9:55 PM Eric Blake <ebl...@redhat.com> wrote:
>
> 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?

I did a simple c&p from util/oslib-win32.c & util/oslib-posix.c.

Should I add some g_critical() ?

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

Reply via email to