aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2023-02-21 16:47:52 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2023-03-13 15:23:37 +0400
commita4aafea26152b58c61c8105ffc574661cdfeb17b (patch)
treeef3d02c05fd0e5574c2132327b3bf7b54d5a2743 /util
parentf5fd677ae7cf7cfb07b12adbfd479c460ddc3ac5 (diff)
downloadqemu-a4aafea26152b58c61c8105ffc574661cdfeb17b.zip
qemu-a4aafea26152b58c61c8105ffc574661cdfeb17b.tar.gz
qemu-a4aafea26152b58c61c8105ffc574661cdfeb17b.tar.bz2
win32/socket: introduce qemu_socket_unselect() helper
A more explicit version of qemu_socket_select() with no events. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Stefan Berger <stefanb@linux.ibm.com> Message-Id: <20230221124802.4103554-8-marcandre.lureau@redhat.com>
Diffstat (limited to 'util')
-rw-r--r--util/oslib-win32.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/util/oslib-win32.c b/util/oslib-win32.c
index df752fc..dbd32ac 100644
--- a/util/oslib-win32.c
+++ b/util/oslib-win32.c
@@ -180,7 +180,7 @@ static int socket_error(void)
void qemu_socket_set_block(int fd)
{
unsigned long opt = 0;
- qemu_socket_select(fd, NULL, 0, NULL);
+ qemu_socket_unselect(fd, NULL);
ioctlsocket(fd, FIONBIO, &opt);
}
@@ -298,6 +298,11 @@ bool qemu_socket_select(SOCKET s, WSAEVENT hEventObject,
return true;
}
+bool qemu_socket_unselect(SOCKET s, Error **errp)
+{
+ return qemu_socket_select(s, NULL, 0, errp);
+}
+
#undef connect
int qemu_connect_wrap(int sockfd, const struct sockaddr *addr,
socklen_t addrlen)