]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix log.c comments about assert vs tor_assert vs raw_assert.
authorNick Mathewson <nickm@torproject.org>
Tue, 28 Aug 2018 19:58:16 +0000 (15:58 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 28 Aug 2018 19:58:16 +0000 (15:58 -0400)
1  2 
doc/tor.1.txt
src/lib/log/log.c

diff --cc doc/tor.1.txt
Simple merge
index e2514a341b957a126f976a037c1ca1ae7ca7a3ca,e2514a341b957a126f976a037c1ca1ae7ca7a3ca..d60ce6308a692088d2656f6cfca9f83ffa3fb083
@@@ -101,7 -101,7 +101,7 @@@ sev_to_string(int severity
      case LOG_NOTICE:  return "notice";
      case LOG_WARN:    return "warn";
      case LOG_ERR:     return "err";
--    default:     /* Call assert, not tor_assert, since tor_assert
++    default:     /* Call raw_assert, not tor_assert, since tor_assert
                    * calls log on failure. */
                   raw_assert_unreached(); return "UNKNOWN"; // LCOV_EXCL_LINE
    }
@@@ -122,7 -122,7 +122,8 @@@ should_log_function_name(log_domain_mas
        /* We care about places where bugs occur. */
        return (domain & (LD_BUG|LD_NOFUNCNAME)) == LD_BUG;
      default:
--      /* Call assert, not tor_assert, since tor_assert calls log on failure. */
++      /* Call raw_assert, not tor_assert, since tor_assert calls
++       * log on failure. */
        raw_assert(0); return 0; // LCOV_EXCL_LINE
    }
  }
@@@ -579,7 -579,7 +580,7 @@@ logv,(int severity, log_domain_mask_t d
    char *end_of_prefix=NULL;
    int callbacks_deferred = 0;
  
--  /* Call assert, not raw_assert, since raw_assert calls log on failure. */
++  /* Call raw_assert, not tor_assert, since tor_assert calls log on failure. */
    raw_assert(format);
    /* check that severity is sane.  Overrunning the masks array leads to
     * interesting and hard to diagnose effects */
@@@ -694,7 -694,7 +695,7 @@@ tor_log_update_sigsafe_err_fds(void
    if (!found_real_stderr &&
        int_array_contains(fds, n_fds, STDOUT_FILENO)) {
      /* Don't use a virtual stderr when we're also logging to stdout. */
--    raw_assert(n_fds >= 2); /* Don't raw_assert inside log fns */
++    raw_assert(n_fds >= 2); /* Don't tor_assert inside log fns */
      fds[0] = fds[--n_fds];
    }