From: s09816 Date: Sat, 15 Aug 2015 02:31:57 +0000 (-0400) Subject: rbd:improve the error handle of rbd,check the return value. X-Git-Tag: v9.1.0~361^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=af0ebeeb0ee04f8c6a82e6d21a1755c360edd886;p=ceph.git rbd:improve the error handle of rbd,check the return value. Signed-off-by: s09816 --- diff --git a/src/rbd.cc b/src/rbd.cc old mode 100644 new mode 100755 index fb399b153d2..f8eedb02ff3 --- a/src/rbd.cc +++ b/src/rbd.cc @@ -3097,7 +3097,10 @@ int main(int argc, const char **argv) return EXIT_FAILURE; } format_specified = true; - g_conf->set_val_or_die("rbd_default_format", val.c_str()); + if (0 != g_conf->set_val("rbd_default_format", val.c_str())) { + cerr << "rbd: image format must be 1 or 2" << std::endl; + return EXIT_FAILURE; + } } else if (ceph_argparse_witharg(args, i, &val, "-p", "--pool", (char*)NULL)) { poolname = strdup(val.c_str()); } else if (ceph_argparse_witharg(args, i, &val, "--dest-pool", (char*)NULL)) {