From: Willem Jan Withagen Date: Tue, 25 Apr 2017 19:30:56 +0000 (+0200) Subject: msg/async/net_handler.cc: fix unused reference for option X-Git-Tag: v12.0.3~142^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9f1e5a92f816a4fb5c5494a898c39fa5f4f60ead;p=ceph.git msg/async/net_handler.cc: fix unused reference for option - If no option value is to be supplied or returned, optval may be NULL - ignore priority options for FreeBSD Signed-off-by: Willem Jan Withagen --- diff --git a/src/msg/async/net_handler.cc b/src/msg/async/net_handler.cc index 5a138d9a5b6..233c8b19021 100644 --- a/src/msg/async/net_handler.cc +++ b/src/msg/async/net_handler.cc @@ -33,7 +33,7 @@ namespace ceph{ int NetHandler::create_socket(int domain, bool reuse_addr) { - int s, on = 1; + int s; if ((s = ::socket(domain, SOCK_STREAM, 0)) == -1) { lderr(cct) << __func__ << " couldn't create socket " << cpp_strerror(errno) << dendl; @@ -44,6 +44,7 @@ int NetHandler::create_socket(int domain, bool reuse_addr) /* Make sure connection-intensive things like the benchmark * will be able to close/open sockets a zillion of times */ if (reuse_addr) { + int on = 1; if (::setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) == -1) { lderr(cct) << __func__ << " setsockopt SO_REUSEADDR failed: " << strerror(errno) << dendl;