]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: improve error messages
authorJosh Durgin <josh.durgin@dreamhost.com>
Tue, 20 Sep 2011 19:50:09 +0000 (12:50 -0700)
committerJosh Durgin <josh.durgin@dreamhost.com>
Tue, 27 Sep 2011 01:10:39 +0000 (18:10 -0700)
One of these was accidentally not negated.

Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
src/rbd.cc

index 5da55850403fbc1e9530fb5589ccff5fd8d71fdf..a081f56d0ee2227ba96b3c3c7e92e6aa24e6655b 100644 (file)
@@ -1048,7 +1048,7 @@ int main(int argc, const char **argv)
   if (talk_to_cluster) {
     r = rados.ioctx_create(poolname, io_ctx);
     if (r < 0) {
-      cerr << "error opening pool " << poolname << " (err=" << r << ")" << std::endl;
+      cerr << "error opening pool " << poolname << ": " << strerror(-r) << std::endl;
       exit(1);
     }
   }
@@ -1060,7 +1060,7 @@ int main(int argc, const char **argv)
        opt_cmd == OPT_COPY)) {
     r = rbd.open(io_ctx, image, imgname);
     if (r < 0) {
-      cerr << "error opening image " << imgname << ": " << strerror(r) << std::endl;
+      cerr << "error opening image " << imgname << ": " << strerror(-r) << std::endl;
       exit(1);
     }
   }
@@ -1076,7 +1076,7 @@ int main(int argc, const char **argv)
   if (opt_cmd == OPT_COPY || opt_cmd == OPT_IMPORT) {
     r = rados.ioctx_create(dest_poolname, dest_io_ctx);
     if (r < 0) {
-      cerr << "error opening pool " << dest_poolname << " (err=" << r << ")" << std::endl;
+      cerr << "error opening pool " << dest_poolname << ": " << strerror(-r) << std::endl;
       exit(1);
     }
   }