tools/osdmaptool: exit if we are unable to resolve pg_num

Signed-off-by: Yan Jun <yan.jun8@zte.com.cn>
This commit is contained in:
Yan Jun 2016-06-04 17:06:40 +08:00
parent ac8c40f3e3
commit c97ec99579

View 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)) {