diff options
author | Sage Weil <sage@newdream.net> | 2013-02-27 08:36:13 -0800 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2013-02-27 08:36:13 -0800 |
commit | babb32996e4b045f1fa95cd4bffac8f7303325f4 (patch) | |
tree | caf66070b45e588b385cd6c1b477411ce8fdb123 | |
parent | ea546aef0c86da521f8a360d4bfd10315af3f46b (diff) | |
parent | 289d81645f0d439f0f9f3aba1427e99595efc6f0 (diff) | |
download | ceph-babb32996e4b045f1fa95cd4bffac8f7303325f4.tar.gz |
Merge pull request #80 from dalgaaf/wip-da-4261
ceph_argparse.cc: accept also 0/1 for boolean injectargs
Reviewed-by: Sage Weil <sage@inktank.com>
-rw-r--r-- | src/common/ceph_argparse.cc | 4 |
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; } |