]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
src/msg/async/net_handler.cc: Fix compilation 31736/head
authorCarlos Valiente <carlos.valiente@ecmwf.int>
Thu, 14 Nov 2019 18:27:50 +0000 (18:27 +0000)
committerNathan Cutler <ncutler@suse.com>
Tue, 19 Nov 2019 12:55:28 +0000 (13:55 +0100)
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 <carlos.valiente@ecmwf.int>
(cherry picked from commit 11974177574178451eb88fcaba011772d29a641d)

src/msg/async/net_handler.cc

index 4e9a2bcbec30b3fd9d4ea6c545fcf15a75b60466..2b4e646d559a44b7591c685899854d43561a94f8 100644 (file)
@@ -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));