]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
msg/async, v2: clean up ret handling in ProtocolV2::write().
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Fri, 8 Mar 2019 15:45:12 +0000 (16:45 +0100)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Sun, 10 Mar 2019 00:12:00 +0000 (01:12 +0100)
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/msg/async/ProtocolV2.cc

index 392ba03897950e06f66498b6bd92096bf04be824..5c83ea24b94607fdf4d8ee69129c49d327d21c8a 100644 (file)
@@ -735,12 +735,11 @@ CtPtr ProtocolV2::write(const std::string &desc,
         run_continuation(next);
       });
 
-  if (r <= 0) {
-    if (r < 0) {
-      ldout(cct, 1) << __func__ << " " << desc << " write failed r=" << r
-                    << " (" << cpp_strerror(r) << ")" << dendl;
-      return _fault();
-    }
+  if (r < 0) {
+    ldout(cct, 1) << __func__ << " " << desc << " write failed r=" << r
+                  << " (" << cpp_strerror(r) << ")" << dendl;
+    return _fault();
+  } else if (r == 0) {
     next.setParams();
     return &next;
   }