@@ -71,7 +71,7 @@ extern char** environ;
71
71
# include <sys/sysctl.h>
72
72
# include <sys/filio.h>
73
73
# include <sys/wait.h>
74
- # if defined(__FreeBSD__ ) && __FreeBSD__ >= 10
74
+ # if defined(__FreeBSD__ )
75
75
# define uv__accept4 accept4
76
76
# endif
77
77
# if defined(__NetBSD__ )
@@ -82,9 +82,6 @@ extern char** environ;
82
82
# define UV__SOCK_NONBLOCK SOCK_NONBLOCK
83
83
# define UV__SOCK_CLOEXEC SOCK_CLOEXEC
84
84
# endif
85
- # if !defined(F_DUP2FD_CLOEXEC ) && defined(_F_DUP2FD_CLOEXEC )
86
- # define F_DUP2FD_CLOEXEC _F_DUP2FD_CLOEXEC
87
- # endif
88
85
#endif
89
86
90
87
#if defined(__ANDROID_API__ ) && __ANDROID_API__ < 21
@@ -475,9 +472,7 @@ int uv__accept(int sockfd) {
475
472
assert (sockfd >= 0 );
476
473
477
474
while (1 ) {
478
- #if defined(__linux__ ) || \
479
- (defined(__FreeBSD__ ) && __FreeBSD__ >= 10 ) || \
480
- defined(__NetBSD__ )
475
+ #if defined(__linux__ ) || defined(__FreeBSD__ ) || defined(__NetBSD__ )
481
476
static int no_accept4 ;
482
477
483
478
if (no_accept4 )
@@ -1032,18 +1027,11 @@ int uv__open_cloexec(const char* path, int flags) {
1032
1027
1033
1028
int uv__dup2_cloexec (int oldfd , int newfd ) {
1034
1029
int r ;
1035
- #if ( defined(__FreeBSD__ ) && __FreeBSD__ >= 10 ) || defined(__NetBSD__ )
1030
+ #if defined(__FreeBSD__ ) || defined(__NetBSD__ )
1036
1031
r = dup3 (oldfd , newfd , O_CLOEXEC );
1037
1032
if (r == -1 )
1038
1033
return UV__ERR (errno );
1039
1034
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. */
1047
1035
#elif defined(__linux__ )
1048
1036
static int no_dup3 ;
1049
1037
if (!no_dup3 ) {
0 commit comments