Tor  0.4.6.0-alpha-dev
torerr_sys.c
Go to the documentation of this file.
1 /* Copyright (c) 2018-2020, The Tor Project, Inc. */
2 /* See LICENSE for licensing information */
3 
4 /**
5  * \file torerr_sys.c
6  * \brief Subsystem object for the error handling subsystem.
7  **/
8 
9 #include "orconfig.h"
10 #include "lib/err/backtrace.h"
11 #include "lib/err/torerr.h"
12 #include "lib/err/torerr_sys.h"
13 #include "lib/subsys/subsys.h"
14 #include "lib/version/torversion.h"
15 
16 #include <stddef.h>
17 
18 static int
19 subsys_torerr_initialize(void)
20 {
22  return -1;
24 
25  return 0;
26 }
27 static void
28 subsys_torerr_shutdown(void)
29 {
30  /* Stop handling signals with backtraces, then flush the logs. */
33 }
34 
35 const subsys_fns_t sys_torerr = {
36  .name = "err",
38  /* Low-level error handling is a diagnostic feature, we want it to init
39  * right after windows process security, and shutdown last.
40  * (Security never shuts down.) */
41  .level = -99,
42  .supported = true,
43  .initialize = subsys_torerr_initialize,
44  .shutdown = subsys_torerr_shutdown
45 };
SUBSYS_DECLARE_LOCATION
#define SUBSYS_DECLARE_LOCATION()
Definition: subsys.h:211
configure_backtrace_handler
int configure_backtrace_handler(const char *tor_version)
Definition: backtrace.c:330
tor_log_flush_sigsafe_err_fds
void tor_log_flush_sigsafe_err_fds(void)
Definition: torerr.c:161
backtrace.h
Header for backtrace.c.
get_version
const char * get_version(void)
Definition: version.c:38
tor_log_reset_sigsafe_err_fds
void tor_log_reset_sigsafe_err_fds(void)
Definition: torerr.c:147
subsys.h
Types used to declare a subsystem.
subsys_fns_t::name
const char * name
Definition: subsys.h:43
clean_up_backtrace_handler
void clean_up_backtrace_handler(void)
Definition: backtrace.c:359
torerr_sys.h
Declare subsystem object for torerr.c.
torerr.h
Headers for torerr.c.
subsys_fns_t
Definition: subsys.h:38
torversion.h
Header for version.c.