From e8ba2281f804e70162ce4c8b2398155b7f58fa98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Tue, 9 Aug 2016 17:32:15 +0100 Subject: [PATCH] unix: remove support for FreeBSD < 10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/libuv/libuv/pull/984 Reviewed-By: Ben Noordhuis Reviewed-By: Johan Bergström --- src/unix/core.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/unix/core.c b/src/unix/core.c index 64522383..965aae79 100644 --- a/src/unix/core.c +++ b/src/unix/core.c @@ -60,14 +60,11 @@ # include # include # define UV__O_CLOEXEC O_CLOEXEC -# if defined(__FreeBSD__) && __FreeBSD__ >= 10 +# if defined(__FreeBSD__) # define uv__accept4 accept4 # define UV__SOCK_NONBLOCK SOCK_NONBLOCK # define UV__SOCK_CLOEXEC SOCK_CLOEXEC # endif -# if !defined(F_DUP2FD_CLOEXEC) && defined(_F_DUP2FD_CLOEXEC) -# define F_DUP2FD_CLOEXEC _F_DUP2FD_CLOEXEC -# endif #endif #if defined(__ANDROID_API__) && __ANDROID_API__ < 21 @@ -446,7 +443,7 @@ int uv__accept(int sockfd) { assert(sockfd >= 0); while (1) { -#if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD__ >= 10) +#if defined(__linux__) || defined(__FreeBSD__) static int no_accept4; if (no_accept4) @@ -970,18 +967,11 @@ int uv__open_cloexec(const char* path, int flags) { int uv__dup2_cloexec(int oldfd, int newfd) { int r; -#if defined(__FreeBSD__) && __FreeBSD__ >= 10 +#if defined(__FreeBSD__) r = dup3(oldfd, newfd, O_CLOEXEC); if (r == -1) return -errno; return r; -#elif defined(__FreeBSD__) && defined(F_DUP2FD_CLOEXEC) - r = fcntl(oldfd, F_DUP2FD_CLOEXEC, newfd); - if (r != -1) - return r; - if (errno != EINVAL) - return -errno; - /* Fall through. */ #elif defined(__linux__) static int no_dup3; if (!no_dup3) {