[tor-commits] [tor/master] Simplify cpd_opts usage.

nickm at torproject.org nickm at torproject.org
Fri Dec 11 01:04:10 UTC 2015


commit 01334589f1eae801b4ed8fb72fe3816ad5b0fe78
Author: Nick Mathewson <nickm at torproject.org>
Date:   Thu Dec 10 20:02:22 2015 -0500

    Simplify cpd_opts usage.
---
 src/or/config.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/or/config.c b/src/or/config.c
index d9ba774..c6d4de3 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -1187,12 +1187,11 @@ options_act_reversible(const or_options_t *old_options, char **msg)
   }
 
   /* Ensure data directory is private; create if possible. */
-  cpd_check_t cpd_group_opts = CPD_NONE;
+  cpd_check_t cpd_opts = running_tor ? CPD_CREATE : CPD_CHECK;
   if (options->DataDirectoryGroupReadable)
-      cpd_group_opts = CPD_GROUP_READ;
+      cpd_opts |= CPD_GROUP_READ;
   if (check_private_dir(options->DataDirectory,
-                        running_tor ?
-                        CPD_CREATE|cpd_group_opts : CPD_CHECK|cpd_group_opts,
+                        cpd_opts,
                         options->User)<0) {
     tor_asprintf(msg,
               "Couldn't access/create private data directory \"%s\"",





More information about the tor-commits mailing list