]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cpp_strerror: handle negative error code
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Mon, 14 Mar 2011 14:45:36 +0000 (07:45 -0700)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Mon, 14 Mar 2011 14:47:08 +0000 (07:47 -0700)
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
src/common/errno.cc

index 44cb749c2766593291c838cb7f6ce1b54305350d..8a2762d67d62367d15d68efb453f8239882762e7 100644 (file)
@@ -8,6 +8,8 @@ std::string cpp_strerror(int err)
 {
   char buf[128];
 
+  if (err < 0)
+    err = -err;
   std::ostringstream oss;
   oss << "error " << err << ": " << strerror_r(err, buf, sizeof(buf));