From: Colin Patrick McCabe Date: Wed, 16 Feb 2011 18:28:48 +0000 (-0800) Subject: monmaptool: fix command-line output X-Git-Tag: v0.25~107 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fc1ce083831a4397c836d4a13b56cd2305de3a32;p=ceph.git monmaptool: fix command-line output Don't check errno if it isn't set. Signed-off-by: Colin McCabe --- diff --git a/src/monmaptool.cc b/src/monmaptool.cc index 8b1fe8957e3a..f45fdb7c14e4 100644 --- a/src/monmaptool.cc +++ b/src/monmaptool.cc @@ -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) { diff --git a/src/test/cli/monmaptool/help.t b/src/test/cli/monmaptool/help.t index 2244c0052b9b..fad1c657bcbd 100644 --- a/src/test/cli/monmaptool/help.t +++ b/src/test/cli/monmaptool/help.t @@ -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] diff --git a/src/test/cli/monmaptool/print-nonexistent.t b/src/test/cli/monmaptool/print-nonexistent.t index 74f0f5d2219f..7e35dcd588e3 100644 --- a/src/test/cli/monmaptool/print-nonexistent.t +++ b/src/test/cli/monmaptool/print-nonexistent.t @@ -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]