summaryrefslogtreecommitdiffstats
path: root/rpc
diff options
context:
space:
mode:
authorMichael Scherer <misc@redhat.com>2017-09-06 11:44:06 +0200
committerJeff Darcy <jeff@pl.atyp.us>2017-09-07 17:54:02 +0000
commit30712dc7d300fb6bffd45f29d9e9ddd83468f38a (patch)
tree891359e33fb479b05046f7e3399213242f76efa8 /rpc
parent07c11798ed219c7d8484d4c1f4729cd83cd4a09e (diff)
Do not declare the variable timeout_ms if TCP_USER_TIMEOUT is not defined
Trying to fix the build on FreeBSD, -Wunused-variable trigger this warning. Change-Id: I318121829ac6a609fe9c606aead257827c7748b1 BUG: 1488829 Signed-off-by: Michael Scherer <misc@redhat.com> Reviewed-on: https://review.gluster.org/18215 Smoke: Gluster Build System <jenkins@build.gluster.org> Tested-by: Michael Scherer <misc@fedoraproject.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Jeff Darcy <jeff@pl.atyp.us>
Diffstat (limited to 'rpc')
-rw-r--r--rpc/rpc-transport/socket/src/socket.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c
index 5cee869..6261e56 100644
--- a/rpc/rpc-transport/socket/src/socket.c
+++ b/rpc/rpc-transport/socket/src/socket.c
@@ -843,7 +843,9 @@ __socket_keepalive (int fd, int family, int keepaliveintvl,
{
int on = 1;
int ret = -1;
+#if defined(TCP_USER_TIMEOUT)
int timeout_ms = timeout * 1000;
+#endif
ret = setsockopt (fd, SOL_SOCKET, SO_KEEPALIVE, &on, sizeof (on));
if (ret == -1) {