Skip to content

Commit 9f1a052

Browse files
committed
unix: remove support for FreeBSD < 10
PR-URL: libuv#2663 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]>
1 parent 018363a commit 9f1a052

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

src/unix/core.c

+3-15
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ extern char** environ;
7171
# include <sys/sysctl.h>
7272
# include <sys/filio.h>
7373
# include <sys/wait.h>
74-
# if defined(__FreeBSD__) && __FreeBSD__ >= 10
74+
# if defined(__FreeBSD__)
7575
# define uv__accept4 accept4
7676
# endif
7777
# if defined(__NetBSD__)
@@ -82,9 +82,6 @@ extern char** environ;
8282
# define UV__SOCK_NONBLOCK SOCK_NONBLOCK
8383
# define UV__SOCK_CLOEXEC SOCK_CLOEXEC
8484
# endif
85-
# if !defined(F_DUP2FD_CLOEXEC) && defined(_F_DUP2FD_CLOEXEC)
86-
# define F_DUP2FD_CLOEXEC _F_DUP2FD_CLOEXEC
87-
# endif
8885
#endif
8986

9087
#if defined(__ANDROID_API__) && __ANDROID_API__ < 21
@@ -475,9 +472,7 @@ int uv__accept(int sockfd) {
475472
assert(sockfd >= 0);
476473

477474
while (1) {
478-
#if defined(__linux__) || \
479-
(defined(__FreeBSD__) && __FreeBSD__ >= 10) || \
480-
defined(__NetBSD__)
475+
#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__)
481476
static int no_accept4;
482477

483478
if (no_accept4)
@@ -1032,18 +1027,11 @@ int uv__open_cloexec(const char* path, int flags) {
10321027

10331028
int uv__dup2_cloexec(int oldfd, int newfd) {
10341029
int r;
1035-
#if (defined(__FreeBSD__) && __FreeBSD__ >= 10) || defined(__NetBSD__)
1030+
#if defined(__FreeBSD__) || defined(__NetBSD__)
10361031
r = dup3(oldfd, newfd, O_CLOEXEC);
10371032
if (r == -1)
10381033
return UV__ERR(errno);
10391034
return r;
1040-
#elif defined(__FreeBSD__) && defined(F_DUP2FD_CLOEXEC)
1041-
r = fcntl(oldfd, F_DUP2FD_CLOEXEC, newfd);
1042-
if (r != -1)
1043-
return r;
1044-
if (errno != EINVAL)
1045-
return UV__ERR(errno);
1046-
/* Fall through. */
10471035
#elif defined(__linux__)
10481036
static int no_dup3;
10491037
if (!no_dup3) {

0 commit comments

Comments
 (0)