diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-08-24 12:48:23 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-08-24 12:48:23 -0400 |
commit | ca09ea0a8b292a6a06a3c05c2a375817d02031e1 (patch) | |
tree | 10b83d772be798045697a45cd34ca6aa4cf2ff75 | |
parent | 03ca9c63c8c04f455eee7aee8adf0554e9bc9952 (diff) | |
download | tor-ca09ea0a8b292a6a06a3c05c2a375817d02031e1.tar tor-ca09ea0a8b292a6a06a3c05c2a375817d02031e1.tar.gz |
Make node_assert_ok less duplicatey
This comes at the cost of making its failure message a little less
friendly, but since when do assertion failures count as
user-friendly?
-rw-r--r-- | src/or/nodelist.h | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/or/nodelist.h b/src/or/nodelist.h index c93b67a25..555882796 100644 --- a/src/or/nodelist.h +++ b/src/or/nodelist.h @@ -12,14 +12,8 @@ #ifndef _TOR_NODELIST_H #define _TOR_NODELIST_H -/* XXX duplicating code from tor_assert(). */ -#define node_assert_ok(n) STMT_BEGIN \ - if (PREDICT_UNLIKELY((n)->ri == NULL && (n)->rs == NULL)) { \ - log_err(LD_BUG, "%s:%d: %s: Node is invalid; aborting.", \ - _SHORT_FILE_, __LINE__, __func__); \ - fprintf(stderr, "%s:%d: %s: Node is invalid; aborting.\n", \ - _SHORT_FILE_, __LINE__, __func__); \ - abort(); \ +#define node_assert_ok(n) STMT_BEGIN { \ + tor_assert((n)->ri || (n)->rs); \ } STMT_END node_t *node_get_mutable_by_id(const char *identity_digest); |