summaryrefslogtreecommitdiff
path: root/deps/uv/src/unix/stream.c
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2017-05-30 13:19:11 -0400
committercjihrig <cjihrig@gmail.com>2017-06-07 09:30:01 -0400
commitedd541957f6bb6fa4ccb56bd1f878172f631ce36 (patch)
tree2a72ce78b05fc122c699d547152414f45d2cc16c /deps/uv/src/unix/stream.c
parent12e39d6d943348a19da1bf84d4891aa28cd3ffb6 (diff)
downloadandroid-node-v8-edd541957f6bb6fa4ccb56bd1f878172f631ce36.tar.gz
android-node-v8-edd541957f6bb6fa4ccb56bd1f878172f631ce36.tar.bz2
android-node-v8-edd541957f6bb6fa4ccb56bd1f878172f631ce36.zip
deps: upgrade libuv to 1.12.0
Fixes: https://github.com/nodejs/node/issues/12853 Fixes: https://github.com/nodejs/node/issues/854 PR-URL: https://github.com/nodejs/node/pull/13306 Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Diffstat (limited to 'deps/uv/src/unix/stream.c')
-rw-r--r--deps/uv/src/unix/stream.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/deps/uv/src/unix/stream.c b/deps/uv/src/unix/stream.c
index 7059df16a6..7b23d16ecf 100644
--- a/deps/uv/src/unix/stream.c
+++ b/deps/uv/src/unix/stream.c
@@ -390,7 +390,7 @@ failed_malloc:
int uv__stream_open(uv_stream_t* stream, int fd, int flags) {
-#if defined(__APPLE__) || defined(__MVS__)
+#if defined(__APPLE__)
int enable;
#endif
@@ -409,7 +409,7 @@ int uv__stream_open(uv_stream_t* stream, int fd, int flags) {
return -errno;
}
-#if defined(__APPLE__) || defined(__MVS__)
+#if defined(__APPLE__)
enable = 1;
if (setsockopt(fd, SOL_SOCKET, SO_OOBINLINE, &enable, sizeof(enable)) &&
errno != ENOTSOCK &&
@@ -785,7 +785,12 @@ start:
struct msghdr msg;
struct cmsghdr *cmsg;
int fd_to_send = uv__handle_fd((uv_handle_t*) req->send_handle);
- char scratch[64] = {0};
+ union {
+ char data[64];
+ struct cmsghdr alias;
+ } scratch;
+
+ memset(&scratch, 0, sizeof(scratch));
assert(fd_to_send >= 0);
@@ -795,7 +800,7 @@ start:
msg.msg_iovlen = iovcnt;
msg.msg_flags = 0;
- msg.msg_control = (void*) scratch;
+ msg.msg_control = &scratch.alias;
msg.msg_controllen = CMSG_SPACE(sizeof(fd_to_send));
cmsg = CMSG_FIRSTHDR(&msg);
@@ -1168,6 +1173,11 @@ static void uv__read(uv_stream_t* stream) {
uv__stream_osx_interrupt_select(stream);
}
stream->read_cb(stream, 0, &buf);
+#if defined(__CYGWIN__) || defined(__MSYS__)
+ } else if (errno == ECONNRESET && stream->type == UV_NAMED_PIPE) {
+ uv__stream_eof(stream, &buf);
+ return;
+#endif
} else {
/* Error. User should call uv_close(). */
stream->read_cb(stream, -errno, &buf);
@@ -1400,6 +1410,12 @@ int uv_write2(uv_write_t* req,
*/
if (uv__handle_fd((uv_handle_t*) send_handle) < 0)
return -EBADF;
+
+#if defined(__CYGWIN__) || defined(__MSYS__)
+ /* Cygwin recvmsg always sets msg_controllen to zero, so we cannot send it.
+ See https://github.com/mirror/newlib-cygwin/blob/86fc4bf0/winsup/cygwin/fhandler_socket.cc#L1736-L1743 */
+ return -ENOSYS;
+#endif
}
/* It's legal for write_queue_size > 0 even when the write_queue is empty;