qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 08/10] Use g_unix_set_fd_nonblocking()


From: Eric Blake
Subject: Re: [PATCH 08/10] Use g_unix_set_fd_nonblocking()
Date: Fri, 22 Apr 2022 09:24:55 -0500
User-agent: NeoMutt/20211029-35-db88c3

On Fri, Apr 22, 2022 at 12:36:37PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> API available since glib 2.30. It also preserves errno.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  hw/misc/ivshmem.c           | 2 +-
>  util/event_notifier-posix.c | 6 ++----
>  util/main-loop.c            | 2 +-
>  3 files changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
> index e7c0099bdaf6..a1cd3dcc51cf 100644
> --- a/hw/misc/ivshmem.c
> +++ b/hw/misc/ivshmem.c
> @@ -537,7 +537,7 @@ static void process_msg_connect(IVShmemState *s, uint16_t 
> posn, int fd,
>  
>      IVSHMEM_DPRINTF("eventfds[%d][%d] = %d\n", posn, vector, fd);
>      event_notifier_init_fd(&peer->eventfds[vector], fd);
> -    fcntl_setfl(fd, O_NONBLOCK); /* msix/irqfd poll non block */
> +    g_unix_set_fd_nonblocking(fd, TRUE, NULL); /* msix/irqfd poll non block 
> */

Does glib require us to use their non-standard TRUE, or can we merely
pass true and rely on C promotion rules to make the code look nicer?

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




reply via email to

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