summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libglusterfs/src/options.c13
-rw-r--r--libglusterfs/src/options.h2
2 files changed, 7 insertions, 8 deletions
diff --git a/libglusterfs/src/options.c b/libglusterfs/src/options.c
index 0cec59fdb06..6ec1478cee3 100644
--- a/libglusterfs/src/options.c
+++ b/libglusterfs/src/options.c
@@ -988,11 +988,8 @@ out:
static int
-not_null (char *in, char **out)
+pass (char *in, char **out)
{
- if (!in || !out)
- return -1;
-
*out = in;
return 0;
}
@@ -1031,7 +1028,7 @@ pc_or_size (char *in, uint64_t *out)
}
-DEFINE_INIT_OPT(char *, str, not_null);
+DEFINE_INIT_OPT(char *, str, pass);
DEFINE_INIT_OPT(uint64_t, uint64, gf_string2uint64);
DEFINE_INIT_OPT(int64_t, int64, gf_string2int64);
DEFINE_INIT_OPT(uint32_t, uint32, gf_string2uint32);
@@ -1041,11 +1038,11 @@ DEFINE_INIT_OPT(uint32_t, percent, gf_string2percent);
DEFINE_INIT_OPT(uint64_t, percent_or_size, pc_or_size);
DEFINE_INIT_OPT(gf_boolean_t, bool, gf_string2boolean);
DEFINE_INIT_OPT(xlator_t *, xlator, xl_by_name);
-DEFINE_INIT_OPT(char *, path, not_null);
+DEFINE_INIT_OPT(char *, path, pass);
-DEFINE_RECONF_OPT(char *, str, not_null);
+DEFINE_RECONF_OPT(char *, str, pass);
DEFINE_RECONF_OPT(uint64_t, uint64, gf_string2uint64);
DEFINE_RECONF_OPT(int64_t, int64, gf_string2int64);
DEFINE_RECONF_OPT(uint32_t, uint32, gf_string2uint32);
@@ -1055,4 +1052,4 @@ DEFINE_RECONF_OPT(uint32_t, percent, gf_string2percent);
DEFINE_RECONF_OPT(uint64_t, percent_or_size, pc_or_size);
DEFINE_RECONF_OPT(gf_boolean_t, bool, gf_string2boolean);
DEFINE_RECONF_OPT(xlator_t *, xlator, xl_by_name);
-DEFINE_RECONF_OPT(char *, path, not_null);
+DEFINE_RECONF_OPT(char *, path, pass);
diff --git a/libglusterfs/src/options.h b/libglusterfs/src/options.h
index 01d2a9d5f1b..8c0ff2499c9 100644
--- a/libglusterfs/src/options.h
+++ b/libglusterfs/src/options.h
@@ -131,6 +131,7 @@ xlator_option_init_##type (xlator_t *this, dict_t *options, char *key, \
if (!value) { \
gf_log (this->name, GF_LOG_TRACE, "option %s not set", \
key); \
+ *val_p = (type_t)0; \
return 0; \
} \
if (value == def_value) { \
@@ -209,6 +210,7 @@ xlator_option_reconf_##type (xlator_t *this, dict_t *options, char *key, \
if (!value) { \
gf_log (this->name, GF_LOG_TRACE, "option %s not set", \
key); \
+ *val_p = (type_t)0; \
return 0; \
} \
if (value == def_value) { \