Skip to content

Commit

Permalink
avoid calling new/malloc in signalhandler.
Browse files Browse the repository at this point in the history
FlushLogFilesUnsafe would be called in FailureSignalHandler,
so should avoid calling new/malloc, which are not signal safe.

fixes google#78
  • Loading branch information
ukai committed Dec 17, 2015
1 parent de75983 commit 0312301
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/logging.cc
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ inline void LogDestination::FlushLogFilesUnsafe(int min_severity) {
// assume we have the log_mutex or we simply don't care
// about it
for (int i = min_severity; i < NUM_SEVERITIES; i++) {
LogDestination* log = log_destination(i);
LogDestination* log = log_destinations_[i];
if (log != NULL) {
// Flush the base fileobject_ logger directly instead of going
// through any wrappers to reduce chance of deadlock.
Expand Down

0 comments on commit 0312301

Please sign in to comment.