Clean up error messages in the previous CL.
TIL PLOG already logs the errno message, so it got logged twice
SignalCatcher::Output. Switch to PLOG for the corresponding messages in
palette_android.cc for brevity, and switch to LOG in the caller since the
errno message already has been logged by then.
Test: adb shell killall -QUIT system_server with a nearly full data
partition; check logcat output.
Bug: 130025619
Change-Id: I973b04461de3492e3cb3e5855fc06e99efe32c0a
diff --git a/libartpalette/system/palette_android.cc b/libartpalette/system/palette_android.cc
index 801f334..9c35d93 100644
--- a/libartpalette/system/palette_android.cc
+++ b/libartpalette/system/palette_android.cc
@@ -115,16 +115,16 @@
bool success = true;
if (!android::base::WriteFully(output_fd, msg, msg_len)) {
- LOG(ERROR) << "Failed to write tombstoned output: " << strerror(errno);
+ PLOG(ERROR) << "Failed to write tombstoned output";
success = false;
} else if (TEMP_FAILURE_RETRY(fsync(output_fd)) == -1) {
- LOG(ERROR) << "Failed to fsync tombstoned output: " << strerror(errno);
+ PLOG(ERROR) << "Failed to fsync tombstoned output";
success = false;
} else if (close(output_fd.release()) == -1) {
// Shouldn't retry close after EINTR because the fd has been closed anyway,
// but don't count it as a failure either.
if (errno != EINTR) {
- LOG(ERROR) << "Failed to close tombstoned output: " << strerror(errno);
+ PLOG(ERROR) << "Failed to close tombstoned output";
success = false;
}
}
diff --git a/runtime/signal_catcher.cc b/runtime/signal_catcher.cc
index 1aa8487..33f582c 100644
--- a/runtime/signal_catcher.cc
+++ b/runtime/signal_catcher.cc
@@ -18,7 +18,6 @@
#include <csignal>
#include <cstdlib>
-#include <cstring>
#include <fcntl.h>
#include <pthread.h>
#include <sys/stat.h>
@@ -111,7 +110,7 @@
LOG(INFO) << "Wrote stack traces to tombstoned";
} else {
CHECK(status == PaletteStatus::kCheckErrno);
- PLOG(ERROR) << "Failed to write stack traces to tombstoned: " << strerror(errno);
+ LOG(ERROR) << "Failed to write stack traces to tombstoned";
LOG(INFO) << s;
}
#else