summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cli/gluster-block.c1
-rw-r--r--utils/common.c20
-rw-r--r--utils/utils.h1
3 files changed, 10 insertions, 12 deletions
diff --git a/cli/gluster-block.c b/cli/gluster-block.c
index 0196437..53f72bc 100644
--- a/cli/gluster-block.c
+++ b/cli/gluster-block.c
@@ -12,7 +12,6 @@
# include "common.h"
# include "block.h"
# include "config.h"
-# include <ctype.h>
# define GB_CREATE_HELP_STR "gluster-block create <volname/blockname> "\
diff --git a/utils/common.c b/utils/common.c
index 4b9237f..98cc0ef 100644
--- a/utils/common.c
+++ b/utils/common.c
@@ -59,33 +59,31 @@ glusterBlockParseSize(const char *dom, char *value)
tmp = tmp + 1;
}
- switch (*tmp) {
- case 'Y':
+ switch (tolower(*tmp)) {
+ case 'y':
sizef *= 1024;
/* fall through */
- case 'Z':
+ case 'z':
sizef *= 1024;
/* fall through */
- case 'E':
+ case 'e':
sizef *= 1024;
/* fall through */
- case 'P':
+ case 'p':
sizef *= 1024;
/* fall through */
- case 'T':
+ case 't':
sizef *= 1024;
/* fall through */
- case 'G':
+ case 'g':
sizef *= 1024;
/* fall through */
- case 'M':
+ case 'm':
sizef *= 1024;
/* fall through */
- case 'K':
case 'k':
sizef *= 1024;
/* fall through */
- case 'B':
case 'b':
case '\0':
break;
@@ -106,7 +104,7 @@ glusterBlockParseSize(const char *dom, char *value)
fail:
LOG(dom, GB_LOG_ERROR, "%s",
"Unknown size unit. "
- "You may use b/B, k/K(iB), M(iB), G(iB), and T(iB) suffixes for "
+ "You may use b/B, k/K(iB), m/M(iB), g/G(iB), and t/T(iB) suffixes for "
"bytes, kibibytes, mebibytes, gibibytes, and tebibytes.");
return -1;
}
diff --git a/utils/utils.h b/utils/utils.h
index bd073ad..8a30d25 100644
--- a/utils/utils.h
+++ b/utils/utils.h
@@ -24,6 +24,7 @@
# include <time.h>
# include <limits.h>
# include <sys/time.h>
+# include <ctype.h>
# define GB_LOGDIR DATADIR "/log/gluster-block"
# define GB_INFODIR DATADIR "/run"