]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph: return error code when failing to get result from admin socket
authorSage Weil <sage@inktank.com>
Wed, 8 May 2013 18:05:29 +0000 (11:05 -0700)
committerSage Weil <sage@inktank.com>
Wed, 8 May 2013 18:05:29 +0000 (11:05 -0700)
Make sure we return a non-zero result code when we fail to read something
from the admin socket.

Backport: cuttlefish, bobtail
Signed-off-by: Sage Weil <sage@inktank.com>
src/tools/ceph.cc

index ed6a5342807cacf982424f3cfe6602ffa180dae9..49a0a0eced7f134fd70aabb323c4ba852bdc7610 100644 (file)
@@ -246,6 +246,7 @@ int do_admin_socket(string path, string cmd)
   }
   if (r < 4) {
     cerr << "read only got " << r << " bytes of 4 expected for response length; invalid command?" << std::endl;
+    r = -1;
     goto out;
   }
   len = ntohl(len);