From: Robin H. Johnson Date: Thu, 4 May 2017 05:31:40 +0000 (-0700) Subject: msg/simple/Pipe: manual backport of fix in PR#14795 X-Git-Tag: v10.2.8~49^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=4ceaa7cce9c9132d47564d79204b48b1d02e531c;p=ceph.git msg/simple/Pipe: manual backport of fix in PR#14795 Manual backport of errno fixup from PR#14795 (6f1037e22c2a304795895498cdc955e0ef80f8e3), as noted by https://github.com/ceph/ceph/pull/13450#discussion_r114696885. Signed-off-by: Robin H. Johnson --- diff --git a/src/msg/simple/Pipe.cc b/src/msg/simple/Pipe.cc index 0a8c78f92a110..a26daadfa036e 100644 --- a/src/msg/simple/Pipe.cc +++ b/src/msg/simple/Pipe.cc @@ -860,15 +860,15 @@ void Pipe::set_socket_options() if (peer_addr.get_family() == AF_INET) { r = ::setsockopt(sd, IPPROTO_IP, IP_TOS, &iptos, sizeof(iptos)); - r = -errno; if (r < 0) { + r = -errno; ldout(msgr->cct,0) << "couldn't set IP_TOS to " << iptos << ": " << cpp_strerror(r) << dendl; } } else if (peer_addr.get_family() == AF_INET6) { r = ::setsockopt(sd, IPPROTO_IPV6, IPV6_TCLASS, &iptos, sizeof(iptos)); - r = -errno; if (r < 0) { + r = -errno; ldout(msgr->cct,0) << "couldn't set IPV6_TCLASS to " << iptos << ": " << cpp_strerror(r) << dendl; }