From: Carlos Valiente Date: Thu, 14 Nov 2019 18:27:50 +0000 (+0000) Subject: src/msg/async/net_handler.cc: Fix compilation X-Git-Tag: v14.2.8~20^2~76^2~5^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8a33561b540cae92561330ad3bd86e0194171c4d;p=ceph.git src/msg/async/net_handler.cc: Fix compilation On a Cray system I'm working on, it seems that `SO_PRIORITY` is defined, but `IPTOS_CLASS_CS6` is not. Without this patch, compilation fails at line 150: ``` r = ::setsockopt(sd, SOL_SOCKET, SO_PRIORITY, &prio, sizeof(prio)); ``` because the variable `r` is not defined (originally it is defined inside the `#ifdef IPTOS_CLASS_CS6` block). Fixes: https://tracker.ceph.com/issues/42821 Signed-off-by: Carlos Valiente (cherry picked from commit 11974177574178451eb88fcaba011772d29a641d) --- diff --git a/src/msg/async/net_handler.cc b/src/msg/async/net_handler.cc index 4e9a2bcbec3..2b4e646d559 100644 --- a/src/msg/async/net_handler.cc +++ b/src/msg/async/net_handler.cc @@ -122,9 +122,9 @@ void NetHandler::set_priority(int sd, int prio, int domain) if (prio < 0) { return; } + int r = -1; #ifdef IPTOS_CLASS_CS6 int iptos = IPTOS_CLASS_CS6; - int r = -1; switch (domain) { case AF_INET: r = ::setsockopt(sd, IPPROTO_IP, IP_TOS, &iptos, sizeof(iptos));