From: Danny Al-Gaaf Date: Wed, 27 Feb 2013 15:40:37 +0000 (+0100) Subject: ceph_argparse.cc: accept also 0/1 for boolean injectargs X-Git-Tag: v0.59~87^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=289d81645f0d439f0f9f3aba1427e99595efc6f0;p=ceph.git ceph_argparse.cc: accept also 0/1 for boolean injectargs Accept also 0 (as false) and 1 (true) as arguments for boolean option on injectargs. Fixes: #4261 Signed-off-by: Danny Al-Gaaf --- diff --git a/src/common/ceph_argparse.cc b/src/common/ceph_argparse.cc index 64e1288cfa89..889c713d736f 100644 --- a/src/common/ceph_argparse.cc +++ b/src/common/ceph_argparse.cc @@ -215,11 +215,11 @@ static bool va_ceph_argparse_binary_flag(std::vector &args, if (first[strlen_a] == '=') { i = args.erase(i); const char *val = first + strlen_a + 1; - if (strcmp(val, "true") == 0) { + if ((strcmp(val, "true") == 0) || (strcmp(val, "1") == 0)) { *ret = 1; return true; } - else if (strcmp(val, "false") == 0) { + else if ((strcmp(val, "false") == 0) || (strcmp(val, "0") == 0)) { *ret = 0; return true; }