diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-08-28 15:58:16 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-08-28 15:58:16 -0400 |
commit | 219f6ea51640cca6abcca8d913188724212d107e (patch) | |
tree | d76ab9bae86f7b1ae7c21535e5da665de0ec0d9c /src/lib/log | |
parent | 2bc4c55d7d17ba9d4dcfacd3f2b118e7144a146d (diff) | |
parent | d9bfc9e2e351ab7048a09f880d79cc696c8e2c91 (diff) | |
download | tor-219f6ea51640cca6abcca8d913188724212d107e.tar.gz tor-219f6ea51640cca6abcca8d913188724212d107e.zip |
Fix log.c comments about assert vs tor_assert vs raw_assert.
Diffstat (limited to 'src/lib/log')
-rw-r--r-- | src/lib/log/log.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/log/log.c b/src/lib/log/log.c index e2514a341b..d60ce6308a 100644 --- a/src/lib/log/log.c +++ b/src/lib/log/log.c @@ -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,8 @@ should_log_function_name(log_domain_mask_t domain, int severity) /* 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 +580,7 @@ logv,(int severity, log_domain_mask_t domain, const char *funcname, 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 +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]; } |