From 5a495cc165c2465ad480ac863006599d7a1c3ad1 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 10 Aug 2017 19:47:57 +0200 Subject: [PATCH] system/fd_util: remove unused function close_socket() --- src/system/fd_util.c | 14 ++++---------- src/system/fd_util.h | 6 ------ 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/system/fd_util.c b/src/system/fd_util.c index b6ad0ebdb..ef3b57cd7 100644 --- a/src/system/fd_util.c +++ b/src/system/fd_util.c @@ -78,6 +78,8 @@ fd_set_cloexec(int fd, bool enable) #endif } +#ifndef WIN32 + /** * Enables non-blocking mode for the specified file descriptor. On * WIN32, this function only works for sockets. @@ -101,6 +103,8 @@ fd_set_nonblock(int fd) #endif } +#endif + int pipe_cloexec_nonblock(int fd[2]) { @@ -127,13 +131,3 @@ pipe_cloexec_nonblock(int fd[2]) return ret; #endif } - -int -close_socket(int fd) -{ -#ifdef WIN32 - return closesocket(fd); -#else - return close(fd); -#endif -} diff --git a/src/system/fd_util.h b/src/system/fd_util.h index b7cbd98ee..9ed193e12 100644 --- a/src/system/fd_util.h +++ b/src/system/fd_util.h @@ -64,12 +64,6 @@ fd_set_cloexec(int fd, bool enable); int pipe_cloexec_nonblock(int fd[2]); -/** - * Portable wrapper for close(); use closesocket() on WIN32/WinSock. - */ -int -close_socket(int fd); - #ifdef __cplusplus } /* extern "C" */ #endif