]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph_argparse.cc: accept also 0/1 for boolean injectargs 80/head
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 27 Feb 2013 15:40:37 +0000 (16:40 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 27 Feb 2013 15:40:37 +0000 (16:40 +0100)
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>
src/common/ceph_argparse.cc

index 64e1288cfa895aafd094c3e4e3012c3707486d12..889c713d736f5150769f97b3a36f09aebff6e52b 100644 (file)
@@ -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;
        }