From 8a33561b540cae92561330ad3bd86e0194171c4d Mon Sep 17 00:00:00 2001 From: Carlos Valiente Date: Thu, 14 Nov 2019 18:27:50 +0000 Subject: [PATCH] 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) --- src/msg/async/net_handler.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/msg/async/net_handler.cc b/src/msg/async/net_handler.cc index 4e9a2bcbec30b..2b4e646d559a4 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)); -- 2.39.5