mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-18 05:28:36 -07:00
win32/socket: introduce qemu_socket_select() helper
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 <marcandre.lureau@redhat.com> Reviewed-by: Stefan Berger <stefanb@linux.ibm.com> Message-Id: <20230221124802.4103554-7-marcandre.lureau@redhat.com>
This commit is contained in:
parent
3ffef1a55c
commit
f5fd677ae7
6 changed files with 30 additions and 10 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue