[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] Make a function for NODUMP.



commit 078ba326a1255dbfbb442219c599e7961f4f85e2
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Sat Aug 24 17:40:38 2019 -0400

    Make a function for NODUMP.
---
 src/app/config/confparse.c | 7 ++++++-
 src/app/config/confparse.h | 1 +
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/app/config/confparse.c b/src/app/config/confparse.c
index 7127e62cd..6e2624466 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 0ae675bcd..d6571692f 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)



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits