Commit db1b7310 by Yasushi Saito Committed by GitHub

Call FailureSignalHandlerOptions.writenfn with nullptr at the end (#938)

* Call FailureSignalHandlerOptions.writenfn with nullptr at the end

This behavior has already been alluded to in the document, but it hasn't been
implemented.

This PR calls changes the failure signal handler to call writerfn(nullptr) at
the end of the message block. It also clarifies the documentation.

https://github.com/abseil/abseil-cpp/issues/933

* Update failure_signal_handler.h

Co-authored-by: Derek Mauro <761129+derekmauro@users.noreply.github.com>
parent 25bc82d7
......@@ -366,6 +366,7 @@ static void AbslFailureSignalHandler(int signo, siginfo_t*, void* ucontext) {
// goes after this point.
if (fsh_options.writerfn != nullptr) {
WriteFailureInfo(signo, ucontext, my_cpu, fsh_options.writerfn);
fsh_options.writerfn(nullptr);
}
if (fsh_options.call_previous_handler) {
......
......@@ -90,7 +90,7 @@ struct FailureSignalHandlerOptions {
// If non-null, indicates a pointer to a callback function that will be called
// upon failure, with a string argument containing failure data. This function
// may be used as a hook to write failure data to a secondary location, such
// as a log file. This function may also be called with null data, as a hint
// as a log file. This function will also be called with null data, as a hint
// to flush any buffered data before the program may be terminated. Consider
// flushing any buffered data in all calls to this function.
//
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment