summaryrefslogtreecommitdiff
path: root/net.c
diff options
context:
space:
mode:
authorMatt Stancliff <matt@genges.com>2014-04-09 10:31:37 -0400
committerMatt Stancliff <matt@genges.com>2014-04-09 17:02:43 -0400
commit4369ee5d086967883ee91597540a599e543eacd6 (patch)
tree9b4dc4b065f9f72226c8129322dfbc1be6db9ebc /net.c
parent05fb7be3eaa94b50b9d4d81f105d5d872c8591a0 (diff)
Fix build under Solaris
Solaris doesn't define the TCP options we try to set. Let's ignore those under Solaris. Closes #207
Diffstat (limited to 'net.c')
-rw-r--r--net.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net.c b/net.c
index 6cbae48..7c787df 100644
--- a/net.c
+++ b/net.c
@@ -130,13 +130,15 @@ int redisKeepAlive(redisContext *c, int interval) {
return REDIS_ERR;
}
-#ifdef _OSX
val = interval;
+
+#ifdef _OSX
if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPALIVE, &val, sizeof(val)) < 0) {
__redisSetError(c,REDIS_ERR_OTHER,strerror(errno));
return REDIS_ERR;
}
#else
+#ifndef __sun
val = interval;
if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, &val, sizeof(val)) < 0) {
__redisSetError(c,REDIS_ERR_OTHER,strerror(errno));
@@ -156,6 +158,7 @@ int redisKeepAlive(redisContext *c, int interval) {
return REDIS_ERR;
}
#endif
+#endif
return REDIS_OK;
}