From bd085aee9b4f7a0bee302ce687964ffb7098f986 Mon Sep 17 00:00:00 2001 From: eeight Date: Thu, 10 Feb 2022 16:46:19 +0300 Subject: Restoring authorship annotation for . Commit 2 of 2. --- .../cpp/terminate_handler/terminate_handler.cpp | 44 +++++++++++----------- library/cpp/terminate_handler/ya.make | 10 ++--- 2 files changed, 27 insertions(+), 27 deletions(-) (limited to 'library/cpp/terminate_handler') diff --git a/library/cpp/terminate_handler/terminate_handler.cpp b/library/cpp/terminate_handler/terminate_handler.cpp index dbc5fb43edf..d7e8fbed95f 100644 --- a/library/cpp/terminate_handler/terminate_handler.cpp +++ b/library/cpp/terminate_handler/terminate_handler.cpp @@ -1,36 +1,36 @@ -#include +#include #include #include #include #include -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 b419b237182..70a9712feda 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 ) -- cgit v1.3