diff options
Diffstat (limited to 'util/oslib-win32.c')
-rw-r--r-- | util/oslib-win32.c | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/util/oslib-win32.c b/util/oslib-win32.c index b9ce2f9..839b8a4 100644 --- a/util/oslib-win32.c +++ b/util/oslib-win32.c @@ -182,7 +182,7 @@ bool qemu_set_blocking(int fd, bool block, Error **errp) unsigned long opt = block ? 0 : 1; if (block) { - qemu_socket_unselect(fd, NULL); + qemu_socket_unselect_nofail(fd); } if (ioctlsocket(fd, FIONBIO, &opt) != NO_ERROR) { @@ -219,6 +219,10 @@ void qemu_set_cloexec(int fd) { } +void qemu_clear_cloexec(int fd) +{ +} + int qemu_get_thread_id(void) { return GetCurrentThreadId(); @@ -293,10 +297,6 @@ bool qemu_socket_select(int sockfd, WSAEVENT hEventObject, { SOCKET s = _get_osfhandle(sockfd); - if (errp == NULL) { - errp = &error_warn; - } - if (s == INVALID_SOCKET) { error_setg(errp, "invalid socket fd=%d", sockfd); return false; @@ -315,6 +315,25 @@ bool qemu_socket_unselect(int sockfd, Error **errp) return qemu_socket_select(sockfd, NULL, 0, errp); } +void qemu_socket_select_nofail(int sockfd, WSAEVENT hEventObject, + long lNetworkEvents) +{ + Error *err = NULL; + + if (!qemu_socket_select(sockfd, hEventObject, lNetworkEvents, &err)) { + warn_report_err(err); + } +} + +void qemu_socket_unselect_nofail(int sockfd) +{ + Error *err = NULL; + + if (!qemu_socket_unselect(sockfd, &err)) { + warn_report_err(err); + } +} + int qemu_socketpair(int domain, int type, int protocol, int sv[2]) { struct sockaddr_un addr = { |