Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Fix TCP_KEEPIDLE build failure in FreeBSD.
Browse files Browse the repository at this point in the history
  • Loading branch information
Herbert Vojčík authored and ry committed Apr 21, 2010
1 parent 5f8f561 commit 4badb22
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/node_net2.cc
Expand Up @@ -1084,13 +1084,11 @@ static Handle<Value> SetKeepAlive(const Arguments& args) {
r = setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, (void *)&flags, sizeof(flags));
if ((time > 0)&&(r >= 0)) {
#if defined(__APPLE__)
// Mac uses a different setting name than Linux
r = setsockopt(fd, IPPROTO_TCP, TCP_KEEPALIVE, (void *)&time, sizeof(time));
#elif defined(__sun)
// Solaris doesn't support TCP_KEEPIDLE, so do nothing here
#else
// assume anything else uses the Linux/BSD method
#elif defined(__linux__)
r = setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, (void *)&time, sizeof(time));
#else
// Solaris nor FreeBSD support TCP_KEEPIDLE, so do nothing here.
#endif
}
if (r < 0) {
Expand Down

0 comments on commit 4badb22

Please sign in to comment.