diff options
author | eeight <eeight@yandex-team.ru> | 2022-02-10 16:46:19 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:19 +0300 |
commit | bd085aee9b4f7a0bee302ce687964ffb7098f986 (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /library/cpp/terminate_handler | |
parent | 475c0a46f28166e83fd263badc7546377cddcabe (diff) | |
download | ydb-bd085aee9b4f7a0bee302ce687964ffb7098f986.tar.gz |
Restoring authorship annotation for <eeight@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/terminate_handler')
-rw-r--r-- | library/cpp/terminate_handler/terminate_handler.cpp | 44 | ||||
-rw-r--r-- | library/cpp/terminate_handler/ya.make | 10 |
2 files changed, 27 insertions, 27 deletions
diff --git a/library/cpp/terminate_handler/terminate_handler.cpp b/library/cpp/terminate_handler/terminate_handler.cpp index dbc5fb43ed..d7e8fbed95 100644 --- a/library/cpp/terminate_handler/terminate_handler.cpp +++ b/library/cpp/terminate_handler/terminate_handler.cpp @@ -1,36 +1,36 @@ -#include <cstdlib> +#include <cstdlib> #include <exception> #include <util/stream/output.h> #include <util/system/backtrace.h> #include <util/generic/yexception.h> -namespace { - // Avoid infinite recursion if std::terminate is triggered anew by the - // FancyTerminateHandler. - thread_local int TerminateCount = 0; +namespace { + // Avoid infinite recursion if std::terminate is triggered anew by the + // FancyTerminateHandler. + thread_local int TerminateCount = 0; - void FancyTerminateHandler() { - switch (++TerminateCount) { - case 1: - break; - case 2: - Cerr << "FancyTerminateHandler called recursively" << Endl; + void FancyTerminateHandler() { + switch (++TerminateCount) { + case 1: + break; + case 2: + Cerr << "FancyTerminateHandler called recursively" << Endl; [[fallthrough]]; - default: - abort(); + default: + abort(); break; - } + } - if (std::current_exception()) { - Cerr << "Uncaught exception: " << CurrentExceptionMessage() << '\n'; - } else { - Cerr << "Terminate for unknown reason (no current exception)\n"; - } - PrintBackTrace(); - Cerr.Flush(); + if (std::current_exception()) { + Cerr << "Uncaught exception: " << CurrentExceptionMessage() << '\n'; + } else { + Cerr << "Terminate for unknown reason (no current exception)\n"; + } + PrintBackTrace(); + Cerr.Flush(); abort(); } - [[maybe_unused]] auto _ = std::set_terminate(&FancyTerminateHandler); + [[maybe_unused]] auto _ = std::set_terminate(&FancyTerminateHandler); } diff --git a/library/cpp/terminate_handler/ya.make b/library/cpp/terminate_handler/ya.make index b419b23718..70a9712fed 100644 --- a/library/cpp/terminate_handler/ya.make +++ b/library/cpp/terminate_handler/ya.make @@ -1,12 +1,12 @@ LIBRARY() -OWNER( - ilnurkh - eeight -) +OWNER( + ilnurkh + eeight +) SRCS( - GLOBAL terminate_handler.cpp + GLOBAL terminate_handler.cpp segv_handler.cpp ) |