sunos: don't set TCP_KEEPALIVE

The system headers advertise the socket option but the actual syscall fails
with ENOPROTOOPT.

Fixes joyent/node#3937.
This commit is contained in:
Ben Noordhuis 2012-09-04 01:20:30 +02:00
parent 24c062cc3e
commit b101a53e6e

View File

@ -310,7 +310,10 @@ int uv__tcp_keepalive(uv_tcp_t* handle, int enable, unsigned int delay) {
}
#endif
#ifdef TCP_KEEPALIVE
/* Solaris/SmartOS, if you don't support keep-alive,
* then don't advertise it in your system headers...
*/
#if defined(TCP_KEEPALIVE) && !defined(__sun)
if (enable && setsockopt(handle->fd,
IPPROTO_TCP,
TCP_KEEPALIVE,