summaryrefslogtreecommitdiffstats
path: root/Utilities/cmlibuv/src/unix/tcp.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-01-21 12:54:36 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-01-21 12:54:45 (GMT)
commit55a2dc3055e8c5f2189c763eb3fd4c9c754d1c05 (patch)
tree9b7c691309d0a0eb52acbd32d5357e038552376c /Utilities/cmlibuv/src/unix/tcp.c
parenteadaf0c8c3b4112d38a19b20a9d303e83640373d (diff)
parent5b3af28e4532eadf92dee229870cadc94be9c635 (diff)
downloadCMake-55a2dc3055e8c5f2189c763eb3fd4c9c754d1c05.zip
CMake-55a2dc3055e8c5f2189c763eb3fd4c9c754d1c05.tar.gz
CMake-55a2dc3055e8c5f2189c763eb3fd4c9c754d1c05.tar.bz2
Merge topic 'update-libuv'
5b3af28e45 libuv: Update CMake-internal buildsystem 1136275ae1 libuv: Include uv/ headers from each other without any path 1e1209729b Merge branch 'upstream-libuv' into update-libuv 4fcb0d0213 libuv 2019-01-15 (f84c5e69) Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2822
Diffstat (limited to 'Utilities/cmlibuv/src/unix/tcp.c')
-rw-r--r--Utilities/cmlibuv/src/unix/tcp.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/Utilities/cmlibuv/src/unix/tcp.c b/Utilities/cmlibuv/src/unix/tcp.c
index 9a46793..2982851 100644
--- a/Utilities/cmlibuv/src/unix/tcp.c
+++ b/Utilities/cmlibuv/src/unix/tcp.c
@@ -216,7 +216,7 @@ int uv__tcp_connect(uv_connect_t* req,
err = maybe_new_socket(handle,
addr->sa_family,
- UV_STREAM_READABLE | UV_STREAM_WRITABLE);
+ UV_HANDLE_READABLE | UV_HANDLE_WRITABLE);
if (err)
return err;
@@ -263,13 +263,16 @@ int uv__tcp_connect(uv_connect_t* req,
int uv_tcp_open(uv_tcp_t* handle, uv_os_sock_t sock) {
int err;
+ if (uv__fd_exists(handle->loop, sock))
+ return UV_EEXIST;
+
err = uv__nonblock(sock, 1);
if (err)
return err;
return uv__stream_open((uv_stream_t*)handle,
sock,
- UV_STREAM_READABLE | UV_STREAM_WRITABLE);
+ UV_HANDLE_READABLE | UV_HANDLE_WRITABLE);
}
@@ -331,7 +334,7 @@ int uv_tcp_listen(uv_tcp_t* tcp, int backlog, uv_connection_cb cb) {
}
if (single_accept)
- tcp->flags |= UV_TCP_SINGLE_ACCEPT;
+ tcp->flags |= UV_HANDLE_TCP_SINGLE_ACCEPT;
flags = 0;
#if defined(__MVS__)
@@ -398,9 +401,9 @@ int uv_tcp_nodelay(uv_tcp_t* handle, int on) {
}
if (on)
- handle->flags |= UV_TCP_NODELAY;
+ handle->flags |= UV_HANDLE_TCP_NODELAY;
else
- handle->flags &= ~UV_TCP_NODELAY;
+ handle->flags &= ~UV_HANDLE_TCP_NODELAY;
return 0;
}
@@ -416,9 +419,9 @@ int uv_tcp_keepalive(uv_tcp_t* handle, int on, unsigned int delay) {
}
if (on)
- handle->flags |= UV_TCP_KEEPALIVE;
+ handle->flags |= UV_HANDLE_TCP_KEEPALIVE;
else
- handle->flags &= ~UV_TCP_KEEPALIVE;
+ handle->flags &= ~UV_HANDLE_TCP_KEEPALIVE;
/* TODO Store delay if uv__stream_fd(handle) == -1 but don't want to enlarge
* uv_tcp_t with an int that's almost never used...
@@ -430,9 +433,9 @@ int uv_tcp_keepalive(uv_tcp_t* handle, int on, unsigned int delay) {
int uv_tcp_simultaneous_accepts(uv_tcp_t* handle, int enable) {
if (enable)
- handle->flags &= ~UV_TCP_SINGLE_ACCEPT;
+ handle->flags &= ~UV_HANDLE_TCP_SINGLE_ACCEPT;
else
- handle->flags |= UV_TCP_SINGLE_ACCEPT;
+ handle->flags |= UV_HANDLE_TCP_SINGLE_ACCEPT;
return 0;
}