Blob Blame History Raw
From a5ff4f6b0b8843b0591c258b7603b2ddbb88b588 Mon Sep 17 00:00:00 2001
From: Kotresh HR <khiremat@redhat.com>
Date: Wed, 19 Apr 2017 05:20:48 -0400
Subject: [PATCH 387/393] glusterd: Fix build failure

"validate_boolean" routine is not in downstream
and is only in upstream. But it's being used in
commit "fc94bc56c6ba0eb9876be606092d6aa8407af0ae"
causing the build failure. Fixing the same.

Label: DOWSNTREAM ONLY

Change-Id: Ie2df1c6cee12797b306266715bc2a682f0cf9cbf
BUG: 1442026
Signed-off-by: Kotresh HR <khiremat@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/103742
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
---
 xlators/mgmt/glusterd/src/glusterd-volume-set.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
index 8e729da..bbb07b0 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
@@ -917,6 +917,28 @@ out:
         return ret;
 }
 
+static int
+validate_boolean (glusterd_volinfo_t *volinfo, dict_t *dict, char *key,
+               char *value, char **op_errstr)
+{
+        xlator_t *this      =       NULL;
+        gf_boolean_t b      =       _gf_false;
+        int ret             =       -1;
+
+        this = THIS;
+        GF_VALIDATE_OR_GOTO ("glusterd", this, out);
+        ret = gf_string2boolean (value, &b);
+        if (ret) {
+                gf_asprintf (op_errstr, "%s is not a valid boolean value. %s "
+                             "expects a valid boolean value.", value, key);
+                gf_msg (this->name, GF_LOG_ERROR, 0,
+                        GD_MSG_INVALID_ENTRY, "%s", *op_errstr);
+        }
+out:
+        gf_msg_debug ("glusterd", 0, "Returning %d", ret);
+
+        return ret;
+}
 
 static int
 validate_parallel_readdir (glusterd_volinfo_t *volinfo, dict_t *dict,
-- 
1.8.3.1