diff options
author | Andy Getzendanner <durandal@google.com> | 2023-05-25 07:09:59 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2023-05-25 07:10:52 -0700 |
commit | 4e4b48faadecb81dc1bd50ada1024a82bb162366 (patch) | |
tree | 9ade1d98cb2a65d80da61454d0cb1c590820b9a6 /absl/debugging | |
parent | c3e9485bdc0556d2cb454ac106786170e3c95e8a (diff) |
Note that AsyncSignalSafeWriteToStderr preserves errno, and inline one use of it into a lambda.
PiperOrigin-RevId: 535245982
Change-Id: I816f60c8b6476536df6836500f01c9a3ad88ddd4
Diffstat (limited to 'absl/debugging')
-rw-r--r-- | absl/debugging/failure_signal_handler.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/absl/debugging/failure_signal_handler.cc b/absl/debugging/failure_signal_handler.cc index 9f399d02..0db2a896 100644 --- a/absl/debugging/failure_signal_handler.cc +++ b/absl/debugging/failure_signal_handler.cc @@ -236,10 +236,6 @@ static void InstallOneFailureHandler(FailureSignalData* data, #endif -static void WriteToStderr(const char* data) { - absl::raw_log_internal::AsyncSignalSafeWriteToStderr(data, strlen(data)); -} - static void WriteSignalMessage(int signo, int cpu, void (*writerfn)(const char*)) { char buf[96]; @@ -380,7 +376,11 @@ static void AbslFailureSignalHandler(int signo, siginfo_t*, void* ucontext) { #endif // First write to stderr. - WriteFailureInfo(signo, ucontext, my_cpu, WriteToStderr); + WriteFailureInfo( + signo, ucontext, my_cpu, +[](const char* data) { + absl::raw_log_internal::AsyncSignalSafeWriteToStderr(data, + strlen(data)); + }); // Riskier code (because it is less likely to be async-signal-safe) // goes after this point. |