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

[tor-commits] [tor/master] Restructure log initilization function to allow multiple backends without arguments.



commit 78a582ed880166a73be284ae799397e84fac36a3
Author: Alexander Færøy <ahf@xxxxxxxxxxxxxx>
Date:   Mon Dec 11 13:00:48 2017 +0000

    Restructure log initilization function to allow multiple backends without arguments.
    
    This patch ensures that we more easily can extend our log backends that
    does not take any additional argument other than a single keyword. This
    patch is mostly reindentation of some code which is why it is split out
    into its own patch.
    
    See: https://bugs.torproject.org/24362
---
 src/or/config.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/or/config.c b/src/or/config.c
index bcfac1dae..676e7f605 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -5732,16 +5732,17 @@ options_init_logs(const or_options_t *old_options, or_options_t *options,
       }
       goto cleanup;
     }
-    if (smartlist_len(elts) == 1 &&
-        !strcasecmp(smartlist_get(elts,0), "syslog")) {
+    if (smartlist_len(elts) == 1) {
+      if (!strcasecmp(smartlist_get(elts,0), "syslog")) {
 #ifdef HAVE_SYSLOG_H
-      if (!validate_only) {
-        add_syslog_log(severity, options->SyslogIdentityTag);
-      }
+        if (!validate_only) {
+          add_syslog_log(severity, options->SyslogIdentityTag);
+        }
 #else
-      log_warn(LD_CONFIG, "Syslog is not supported on this system. Sorry.");
+        log_warn(LD_CONFIG, "Syslog is not supported on this system. Sorry.");
 #endif /* defined(HAVE_SYSLOG_H) */
-      goto cleanup;
+        goto cleanup;
+      }
     }
 
     if (smartlist_len(elts) == 2 &&



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