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
(cherry picked from commit 9b70ee0fdb1969a9a5cad2052b35c2fa04509bc2)
Change-Id: Iccc19e3594fe7e8c6ff2fbdec9203c49190b06d1
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