From f5fd677ae7cf7cfb07b12adbfd479c460ddc3ac5 Mon Sep 17 00:00:00 2001 From: Marc-André Lureau Date: Tue, 21 Feb 2023 16:47:51 +0400 Subject: win32/socket: introduce qemu_socket_select() helper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a wrapper for WSAEventSelect, with Error handling. By default, it will produce a warning, so callers don't have to be modified now, and yet we can spot potential mis-use. Signed-off-by: Marc-André Lureau Reviewed-by: Stefan Berger Message-Id: <20230221124802.4103554-7-marcandre.lureau@redhat.com> --- io/channel-socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'io/channel-socket.c') diff --git a/io/channel-socket.c b/io/channel-socket.c index 2040297d2b..0bc29c4808 100644 --- a/io/channel-socket.c +++ b/io/channel-socket.c @@ -442,7 +442,7 @@ static void qio_channel_socket_finalize(Object *obj) } } #ifdef WIN32 - WSAEventSelect(ioc->fd, NULL, 0); + qemu_socket_select(ioc->fd, NULL, 0, NULL); #endif closesocket(ioc->fd); ioc->fd = -1; @@ -846,7 +846,7 @@ qio_channel_socket_close(QIOChannel *ioc, if (sioc->fd != -1) { #ifdef WIN32 - WSAEventSelect(sioc->fd, NULL, 0); + qemu_socket_select(sioc->fd, NULL, 0, NULL); #endif if (qio_channel_has_feature(ioc, QIO_CHANNEL_FEATURE_LISTEN)) { socket_listen_cleanup(sioc->fd, errp); -- cgit 1.4.1