]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tools/osdmaptool: exit if we are unable to resolve pg_num
authorYan Jun <yan.jun8@zte.com.cn>
Sat, 4 Jun 2016 09:06:40 +0000 (17:06 +0800)
committerYan Jun <yan.jun8@zte.com.cn>
Sat, 4 Jun 2016 11:00:23 +0000 (19:00 +0800)
Signed-off-by: Yan Jun <yan.jun8@zte.com.cn>
src/tools/osdmaptool.cc

index 6b4a3f18c30ce2156521149dc6c8961feb53a5ac..a61346a9b19ee46354cdf1cc5a2fe3395a26d012 100644 (file)
@@ -137,8 +137,10 @@ int main(int argc, const char **argv)
     } else if (ceph_argparse_witharg(args, i, &val, err, "--pg_num", (char*)NULL)) {
       string interr;
       pg_num = strict_strtoll(val.c_str(), 10, &interr);
-      if (interr.length() > 0)
+      if (interr.length() > 0) {
         cerr << "error parsing integer value " << interr << std::endl;
+        exit(EXIT_FAILURE);
+      }
     } else if (ceph_argparse_witharg(args, i, &range_first, err, "--range_first", (char*)NULL)) {
     } else if (ceph_argparse_witharg(args, i, &range_last, err, "--range_last", (char*)NULL)) {
     } else if (ceph_argparse_witharg(args, i, &pool, err, "--pool", (char*)NULL)) {