From 9f1a0520944ebde3dccc3ffe4ee75e908db730e6 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 PR-URL: https://github.com/libuv/libuv/pull/2663 Reviewed-By: Ben Noordhuis Reviewed-By: Santiago Gimeno --- src/unix/core.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/src/unix/core.c b/src/unix/core.c index 75f9cd38..7475da58 100644 --- a/src/unix/core.c +++ b/src/unix/core.c @@ -71,7 +71,7 @@ extern char** environ; # include # include # include -# if defined(__FreeBSD__) && __FreeBSD__ >= 10 +# if defined(__FreeBSD__) # define uv__accept4 accept4 # endif # if defined(__NetBSD__) @@ -82,9 +82,6 @@ extern char** environ; # 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 @@ -475,9 +472,7 @@ int uv__accept(int sockfd) { assert(sockfd >= 0); while (1) { -#if defined(__linux__) || \ - (defined(__FreeBSD__) && __FreeBSD__ >= 10) || \ - defined(__NetBSD__) +#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) static int no_accept4; if (no_accept4) @@ -1032,18 +1027,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) || defined(__NetBSD__) +#if defined(__FreeBSD__) || defined(__NetBSD__) r = dup3(oldfd, newfd, O_CLOEXEC); if (r == -1) return UV__ERR(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 UV__ERR(errno); - /* Fall through. */ #elif defined(__linux__) static int no_dup3; if (!no_dup3) {