From: Yan Jun Date: Sat, 4 Jun 2016 09:06:40 +0000 (+0800) Subject: tools/osdmaptool: exit if we are unable to resolve pg_num X-Git-Tag: v11.0.0~306^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c97ec9957930cffbf1ed4b589c1f75804afc571f;p=ceph.git tools/osdmaptool: exit if we are unable to resolve pg_num Signed-off-by: Yan Jun --- diff --git a/src/tools/osdmaptool.cc b/src/tools/osdmaptool.cc index 6b4a3f18c30c..a61346a9b19e 100644 --- a/src/tools/osdmaptool.cc +++ b/src/tools/osdmaptool.cc @@ -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)) {