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.

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 4e9d6c8321
commit 19d3d506de

View File

@ -394,7 +394,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 -errno;
}
#endif