Use PLOG instead of LOG with strerror()
This patch replaces "LOG() << ... << strerror(errno)" by "PLOG() << ..."
when possible, which provides equivalent functionality.
BUG=None
TEST=cbuildbot amd64-generic-full
Change-Id: I760689818a3647efa980c96305a0bc8cf0bb4ac0
Reviewed-on: https://chromium-review.googlesource.com/264834
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
Trybot-Ready: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
diff --git a/utils.h b/utils.h
index 6d8b373..f242c39 100644
--- a/utils.h
+++ b/utils.h
@@ -522,8 +522,7 @@
should_remove_(true) {}
~ScopedPathUnlinker() {
if (should_remove_ && unlink(path_.c_str()) < 0) {
- std::string err_message = strerror(errno);
- LOG(ERROR) << "Unable to unlink path " << path_ << ": " << err_message;
+ PLOG(ERROR) << "Unable to unlink path " << path_;
}
}
void set_should_remove(bool should_remove) { should_remove_ = should_remove; }