win32: replace closesocket() with close() wrapper

Use a close() wrapper instead, so that we don't need to worry about
closesocket() vs close() anymore, let's hope.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
Message-Id: <20230221124802.4103554-17-marcandre.lureau@redhat.com>
This commit is contained in:
Marc-André Lureau 2023-02-21 16:48:01 +04:00
parent b7e5374637
commit 25657fc6c1
14 changed files with 89 additions and 89 deletions

View file

@ -51,8 +51,6 @@ void os_daemonize(void);
void os_setup_post(void);
int os_mlock(void);
#define closesocket(s) close(s)
int os_set_daemonize(bool d);
bool is_daemonized(void);

View file

@ -175,6 +175,10 @@ bool qemu_socket_unselect(int sockfd, Error **errp);
* set errno based on WSAGetLastError()
*/
#undef close
#define close qemu_close_wrap
int qemu_close_wrap(int fd);
#undef connect
#define connect qemu_connect_wrap
int qemu_connect_wrap(int sockfd, const struct sockaddr *addr,
@ -206,10 +210,6 @@ int qemu_shutdown_wrap(int sockfd, int how);
#define ioctlsocket qemu_ioctlsocket_wrap
int qemu_ioctlsocket_wrap(int fd, int req, void *val);
#undef closesocket
#define closesocket qemu_closesocket_wrap
int qemu_closesocket_wrap(int fd);
#undef getsockopt
#define getsockopt qemu_getsockopt_wrap
int qemu_getsockopt_wrap(int sockfd, int level, int optname,