From b101a53e6ef80945f12c91263a4b41b45b8b4344 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Tue, 4 Sep 2012 01:20:30 +0200 Subject: [PATCH] sunos: don't set TCP_KEEPALIVE The system headers advertise the socket option but the actual syscall fails with ENOPROTOOPT. Fixes joyent/node#3937. --- src/unix/tcp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/unix/tcp.c b/src/unix/tcp.c index 233be825..e6db3b51 100644 --- a/src/unix/tcp.c +++ b/src/unix/tcp.c @@ -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,