"Fossies" - the Fresh Open Source Software Archive

Member "tor-0.4.1.6/src/lib/err/torerr_sys.c" (10 Jun 2019, 840 Bytes) of package /linux/misc/tor-0.4.1.6.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "torerr_sys.c" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 0.4.1.6_vs_0.4.2.4-rc.

    1 /* Copyright (c) 2018-2019, 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 {
   21   if (configure_backtrace_handler(get_version()) < 0)
   22     return -1;
   23   tor_log_reset_sigsafe_err_fds();
   24 
   25   return 0;
   26 }
   27 static void
   28 subsys_torerr_shutdown(void)
   29 {
   30   tor_log_reset_sigsafe_err_fds();
   31   clean_up_backtrace_handler();
   32 }
   33 
   34 const subsys_fns_t sys_torerr = {
   35   .name = "err",
   36   .level = -100,
   37   .supported = true,
   38   .initialize = subsys_torerr_initialize,
   39   .shutdown = subsys_torerr_shutdown
   40 };