summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-08-24 17:40:38 -0400
committerNick Mathewson <nickm@torproject.org>2019-08-24 17:40:48 -0400
commit078ba326a1255dbfbb442219c599e7961f4f85e2 (patch)
treeeafa8e63af6889fa4fbabdc612bbaeb660044df0
parenteb54fe8f97701a11e30009a94f11b7e3e5d69b4f (diff)
downloadtor-078ba326a1255dbfbb442219c599e7961f4f85e2.tar.gz
tor-078ba326a1255dbfbb442219c599e7961f4f85e2.zip
Make a function for NODUMP.
-rw-r--r--src/app/config/confparse.c7
-rw-r--r--src/app/config/confparse.h1
2 files changed, 7 insertions, 1 deletions
diff --git a/src/app/config/confparse.c b/src/app/config/confparse.c
index 7127e62cde..6e2624466a 100644
--- a/src/app/config/confparse.c
+++ b/src/app/config/confparse.c
@@ -169,6 +169,11 @@ config_var_is_invisible(const config_var_t *var)
{
return (var->flags & CVFLAG_INVISIBLE) != 0;
}
+bool
+config_var_is_dumpable(const config_var_t *var)
+{
+ return (var->flags & CVFLAG_NODUMP) == 0;
+}
/*
* Functions to assign config options.
@@ -646,7 +651,7 @@ config_dump(const config_format_t *fmt, const void *default_options,
continue;
}
/* Don't save 'hidden' control variables. */
- if (fmt->vars[i].flags & CVFLAG_NODUMP)
+ if (! config_var_is_dumpable(&fmt->vars[i]))
continue;
if (minimal && config_is_same(fmt, options, defaults,
fmt->vars[i].member.name))
diff --git a/src/app/config/confparse.h b/src/app/config/confparse.h
index 0ae675bcdf..d6571692f9 100644
--- a/src/app/config/confparse.h
+++ b/src/app/config/confparse.h
@@ -108,6 +108,7 @@ bool config_var_is_cumulative(const config_var_t *var);
bool config_var_is_settable(const config_var_t *var);
bool config_var_is_contained(const config_var_t *var);
bool config_var_is_invisible(const config_var_t *var);
+bool config_var_is_dumpable(const config_var_t *var);
/* Helper macros to compare an option across two configuration objects */
#define CFG_EQ_BOOL(a,b,opt) ((a)->opt == (b)->opt)