diff options
Diffstat (limited to 'src/lib/log/util_bug.c')
-rw-r--r-- | src/lib/log/util_bug.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lib/log/util_bug.c b/src/lib/log/util_bug.c index f42d2d2ab4..c65a91ae9e 100644 --- a/src/lib/log/util_bug.c +++ b/src/lib/log/util_bug.c @@ -19,6 +19,7 @@ #include "lib/string/printf.h" #include <string.h> +#include <stdlib.h> #ifdef TOR_UNIT_TESTS static void (*failed_assertion_cb)(void) = NULL; @@ -120,6 +121,19 @@ tor_bug_occurred_(const char *fname, unsigned int line, #endif } +/** + * Call the abort() function to kill the current process with a fatal + * error. + * + * (This is a separate function so that we declare it in util_bug.h without + * including stdlib in all the users of util_bug.h) + **/ +void +tor_abort_(void) +{ + abort(); +} + #ifdef _WIN32 /** Take a filename and return a pointer to its final element. This * function is called on __FILE__ to fix a MSVC nit where __FILE__ |