stream: ignore EINVAL for SO_OOBINLINE on OS X

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 <info@bnoordhuis.nl>
Reviewed-By: Bert Belder <bertbelder@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
This commit is contained in:
Fedor Indutny 2015-02-25 23:17:23 +03:00 committed by Saúl Ibarra Corretgé
parent 2797aa329e
commit e28a5d55ba

View File

@ -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