system/fd_util: remove unused function accept_cloexec_nonblock()

This commit is contained in:
Max Kellermann 2017-08-10 19:47:40 +02:00
parent 0c1740982d
commit 9ff4717738
2 changed files with 0 additions and 36 deletions

View File

@ -128,34 +128,6 @@ pipe_cloexec_nonblock(int fd[2])
#endif
}
int
accept_cloexec_nonblock(int fd, struct sockaddr *address,
size_t *address_length_r)
{
int ret;
socklen_t address_length = *address_length_r;
#ifdef HAVE_ACCEPT4
ret = accept4(fd, address, &address_length,
SOCK_CLOEXEC|SOCK_NONBLOCK);
if (ret >= 0 || errno != ENOSYS) {
if (ret >= 0)
*address_length_r = address_length;
return ret;
}
#endif
ret = accept(fd, address, &address_length);
if (ret >= 0) {
fd_set_cloexec(ret, true);
fd_set_nonblock(ret);
*address_length_r = address_length;
}
return ret;
}
int
close_socket(int fd)
{

View File

@ -64,14 +64,6 @@ fd_set_cloexec(int fd, bool enable);
int
pipe_cloexec_nonblock(int fd[2]);
/**
* Wrapper for accept(), which sets the CLOEXEC and the NONBLOCK flags
* (atomically if supported by the OS).
*/
int
accept_cloexec_nonblock(int fd, struct sockaddr *address,
size_t *address_length_r);
/**
* Portable wrapper for close(); use closesocket() on WIN32/WinSock.
*/