From e28a5d55ba267ddc9ecd26a6f9b1f683613048ff Mon Sep 17 00:00:00 2001 From: Fedor Indutny Date: Wed, 25 Feb 2015 23:17:23 +0300 Subject: [PATCH] stream: ignore EINVAL for SO_OOBINLINE on OS X MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Calling `setsockopt()` on shutdown fds/stdio will result in EINVAL. There is not much problem here as the OOB data can't be sent to already shutdown fds. Just ignore it and go on. Cherry-picked from v1.x (19d3d50) PR-URL: https://github.com/libuv/libuv/pull/228 Reviewed-By: Ben Noordhuis Reviewed-By: Bert Belder Reviewed-By: Saúl Ibarra Corretgé --- src/unix/stream.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/unix/stream.c b/src/unix/stream.c index 7854d24f..a8802c85 100644 --- a/src/unix/stream.c +++ b/src/unix/stream.c @@ -422,7 +422,8 @@ int uv__stream_open(uv_stream_t* stream, int fd, int flags) { #if defined(__APPLE__) enable = 1; if (setsockopt(fd, SOL_SOCKET, SO_OOBINLINE, &enable, sizeof(enable)) && - errno != ENOTSOCK) { + errno != ENOTSOCK && + errno != EINVAL) { return uv__set_sys_error(stream->loop, errno); } #endif