summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>2013-02-27 16:40:37 +0100
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>2013-02-27 16:40:37 +0100
commit289d81645f0d439f0f9f3aba1427e99595efc6f0 (patch)
treecaf66070b45e588b385cd6c1b477411ce8fdb123
parentea546aef0c86da521f8a360d4bfd10315af3f46b (diff)
downloadceph-289d81645f0d439f0f9f3aba1427e99595efc6f0.tar.gz
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 <danny.al-gaaf@bisect.de>
-rw-r--r--src/common/ceph_argparse.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/ceph_argparse.cc b/src/common/ceph_argparse.cc
index 64e1288cfa8..889c713d736 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<const char*> &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;
}