]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
monmaptool: fix command-line output
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Wed, 16 Feb 2011 18:28:48 +0000 (10:28 -0800)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Wed, 16 Feb 2011 18:28:48 +0000 (10:28 -0800)
Don't check errno if it isn't set.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
src/monmaptool.cc
src/test/cli/monmaptool/help.t
src/test/cli/monmaptool/print-nonexistent.t

index 8b1fe8957e3aa7cc7b0379c4743a2eb609698a4f..f45fdb7c14e4c893073d10a75e61b9e879d216bb 100644 (file)
@@ -101,7 +101,7 @@ int main(int argc, const char **argv)
 
   char buf[80];
   if (!create && r < 0) {
-    cerr << me << ": couldn't open " << fn << ": " << strerror_r(errno, buf, sizeof(buf)) << std::endl;
+    cerr << me << ": couldn't open " << fn << ": " << strerror_r(-r, buf, sizeof(buf)) << std::endl;
     return -1;
   }    
   else if (create && !clobber && r == 0) {
index 2244c0052b9b85e59ec6cbbb3a3ca699b8625829..fad1c657bcbd523234db35e781a32e90e558dda7 100644 (file)
@@ -2,5 +2,5 @@
   $ monmaptool --help
   monmaptool: monmap file --help
   \d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d+ [0-9a-f]{8,} can't open --help: error 2: No such file or directory (re)
-  monmaptool: couldn't open --help: Is a directory
+  monmaptool: couldn't open --help: No such file or directory
   [255]
index 74f0f5d2219f89efd001a7661154a166d70e4d81..7e35dcd588e3820ac467c546c10ab0f2f9343675 100644 (file)
@@ -1,5 +1,5 @@
   $ monmaptool --print nonexistent
   monmaptool: monmap file nonexistent
   \d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d+ [0-9a-f]{8,} can't open nonexistent: error 2: No such file or directory (re)
-  monmaptool: couldn't open nonexistent: Is a directory
+  monmaptool: couldn't open nonexistent: No such file or directory
   [255]