From 245ee93f275301ad7f277b37614a30853d9def36 Mon Sep 17 00:00:00 2001 From: Prasanna Kumar Kalever Date: Sun, 19 Feb 2017 14:40:12 +0530 Subject: gluster-block: refactor return values Signed-off-by: Prasanna Kumar Kalever --- utils/common.c | 10 +++++----- utils/common.h | 2 +- utils/utils.h | 2 ++ 3 files changed, 8 insertions(+), 6 deletions(-) (limited to 'utils') diff --git a/utils/common.c b/utils/common.c index dfa6bc8..a605f0d 100644 --- a/utils/common.c +++ b/utils/common.c @@ -14,7 +14,7 @@ ssize_t -glusterBlockCreateParseSize(char *value) +glusterBlockCreateParseSize(const char *dom, char *value) { char *postfix; char *tmp; @@ -26,7 +26,7 @@ glusterBlockCreateParseSize(char *value) sizef = strtod(value, &postfix); if (sizef < 0) { - ERROR("%s", "size cannot be negative number\n"); + LOG(dom, GB_LOG_ERROR, "%s", "size cannot be negative number"); return -1; } @@ -66,9 +66,9 @@ glusterBlockCreateParseSize(char *value) return sizef; break; default: - /*TODO: Log this instead of printing - ERROR("%s", "You may use k/K, M, G or T suffixes for " - "kilobytes, megabytes, gigabytes and terabytes."); */ + LOG(dom, GB_LOG_ERROR, "%s", + "You may use k/K, M, G or T suffixes for kilobytes, " + "megabytes, gigabytes and terabytes."); return -1; } } diff --git a/utils/common.h b/utils/common.h index 7cac49a..6bb3273 100644 --- a/utils/common.h +++ b/utils/common.h @@ -33,6 +33,6 @@ # define SUN_PATH_MAX (sizeof(struct sockaddr_un) - sizeof(unsigned short int)) /*sun_family*/ -ssize_t glusterBlockCreateParseSize(char *value); +ssize_t glusterBlockCreateParseSize(const char *dom, char *value); # endif /* _COMMON_H */ diff --git a/utils/utils.h b/utils/utils.h index fc9e1ef..6bae689 100644 --- a/utils/utils.h +++ b/utils/utils.h @@ -290,6 +290,7 @@ typedef enum Metakey { GB_META_SIZE = 2, GB_META_HA = 3, GB_META_ENTRYCREATE = 4, + GB_META_ENTRYDELETE = 5, GB_METAKEY_MAX } Metakey; @@ -300,6 +301,7 @@ static const char *const MetakeyLookup[] = { [GB_META_SIZE] = "SIZE", [GB_META_HA] = "HA", [GB_META_ENTRYCREATE] = "ENTRYCREATE", + [GB_META_ENTRYDELETE] = "ENTRYDELETE", [GB_METAKEY_MAX] = NULL }; -- cgit