unix: use the presence of SOCK_* instead of OS macros for socketpair
--------- Signed-off-by: Andy Pan <i@andypan.me>
This commit is contained in:
parent
287987b37c
commit
ab3ecf6565
@ -610,7 +610,7 @@ void uv__tcp_close(uv_tcp_t* handle) {
|
|||||||
int uv_socketpair(int type, int protocol, uv_os_sock_t fds[2], int flags0, int flags1) {
|
int uv_socketpair(int type, int protocol, uv_os_sock_t fds[2], int flags0, int flags1) {
|
||||||
uv_os_sock_t temp[2];
|
uv_os_sock_t temp[2];
|
||||||
int err;
|
int err;
|
||||||
#if defined(__FreeBSD__) || defined(__linux__)
|
#if defined(SOCK_NONBLOCK) && defined(SOCK_CLOEXEC)
|
||||||
int flags;
|
int flags;
|
||||||
|
|
||||||
flags = type | SOCK_CLOEXEC;
|
flags = type | SOCK_CLOEXEC;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user