diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2023-02-21 16:48:01 +0400 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2023-03-13 15:39:31 +0400 |
commit | 25657fc6c1b693096e2ceadaa53cd10c1e81c8d9 (patch) | |
tree | 02de623f13a1d265022ddbdbf7433eb33f929d23 /include | |
parent | b7e5374637daffa49657be2c559a0566836a172f (diff) | |
download | qemu-25657fc6c1b693096e2ceadaa53cd10c1e81c8d9.zip qemu-25657fc6c1b693096e2ceadaa53cd10c1e81c8d9.tar.gz qemu-25657fc6c1b693096e2ceadaa53cd10c1e81c8d9.tar.bz2 |
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>
Diffstat (limited to 'include')
-rw-r--r-- | include/sysemu/os-posix.h | 2 | ||||
-rw-r--r-- | include/sysemu/os-win32.h | 8 |
2 files changed, 4 insertions, 6 deletions
diff --git a/include/sysemu/os-posix.h b/include/sysemu/os-posix.h index 378213f..1030d39 100644 --- a/include/sysemu/os-posix.h +++ b/include/sysemu/os-posix.h @@ -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); diff --git a/include/sysemu/os-win32.h b/include/sysemu/os-win32.h index cb1dcce..e2849f8 100644 --- a/include/sysemu/os-win32.h +++ b/include/sysemu/os-win32.h @@ -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, |