]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Simplify cpd_opts usage.
authorNick Mathewson <nickm@torproject.org>
Fri, 11 Dec 2015 01:02:22 +0000 (20:02 -0500)
committerNick Mathewson <nickm@torproject.org>
Fri, 11 Dec 2015 01:02:22 +0000 (20:02 -0500)
src/or/config.c

index d9ba774e7e1d3c2c133fb8ae85a4b2ecc1d8744d..c6d4de386d9c7c4536fa8e4da2e319c1fa8815ca 100644 (file)
@@ -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\"",