diff --git a/apps/nc/compat/sys/socket.h b/apps/nc/compat/sys/socket.h index 13eb380..2c7ee4f 100644 --- a/apps/nc/compat/sys/socket.h +++ b/apps/nc/compat/sys/socket.h @@ -6,8 +6,7 @@ #ifndef _WIN32 #include_next -#if !defined(SOCK_NONBLOCK) || !defined(SOCK_CLOEXEC) -#define NEED_SOCKET_FLAGS +#if defined(NEED_SOCKET_FLAGS) int _socket(int domain, int type, int protocol); #ifndef SOCKET_FLAGS_PRIV #define socket(d, t, p) _socket(d, t, p) diff --git a/include/compat/sys/socket.h b/include/compat/sys/socket.h index 10eb05f..2f0b197 100644 --- a/include/compat/sys/socket.h +++ b/include/compat/sys/socket.h @@ -10,6 +10,7 @@ #endif #if !defined(SOCK_NONBLOCK) || !defined(SOCK_CLOEXEC) +#define NEED_SOCKET_FLAGS #define SOCK_CLOEXEC 0x8000 /* set FD_CLOEXEC */ #define SOCK_NONBLOCK 0x4000 /* set O_NONBLOCK */ int bsd_socketpair(int domain, int type, int protocol, int socket_vector[2]);