From 0800d9427cb60180be334e061ae9bdf5d3ac3506 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 10 Aug 2017 17:40:14 +0200 Subject: [PATCH] system/fd_util: remove unused function socket_cloexec_nonblock() --- src/system/fd_util.c | 20 -------------------- src/system/fd_util.h | 12 ------------ 2 files changed, 32 deletions(-) diff --git a/src/system/fd_util.c b/src/system/fd_util.c index ed18991ce..d554ad796 100644 --- a/src/system/fd_util.c +++ b/src/system/fd_util.c @@ -148,26 +148,6 @@ pipe_cloexec_nonblock(int fd[2]) #endif } -int -socket_cloexec_nonblock(int domain, int type, int protocol) -{ - int fd; - -#if defined(SOCK_CLOEXEC) && defined(SOCK_NONBLOCK) - fd = socket(domain, type | SOCK_CLOEXEC | SOCK_NONBLOCK, protocol); - if (fd >= 0 || errno != EINVAL) - return fd; -#endif - - fd = socket(domain, type, protocol); - if (fd >= 0) { - fd_set_cloexec(fd, true); - fd_set_nonblock(fd); - } - - return fd; -} - int accept_cloexec_nonblock(int fd, struct sockaddr *address, size_t *address_length_r) diff --git a/src/system/fd_util.h b/src/system/fd_util.h index 0b26ba711..1b0126f85 100644 --- a/src/system/fd_util.h +++ b/src/system/fd_util.h @@ -71,18 +71,6 @@ open_cloexec(const char *path_fs, int flags, int mode); int pipe_cloexec_nonblock(int fd[2]); -#ifdef ENABLE_LIBMPDCLIENT -/* Avoid symbol conflict with statically linked libmpdclient */ -#define socket_cloexec_nonblock socket_cloexec_nonblock_noconflict -#endif - -/** - * Wrapper for socket(), which sets the CLOEXEC and the NONBLOCK flag - * (atomically if supported by the OS). - */ -int -socket_cloexec_nonblock(int domain, int type, int protocol); - /** * Wrapper for accept(), which sets the CLOEXEC and the NONBLOCK flags * (atomically if supported by the OS).