wificond: use PLOG rather than LOG sterror.
Bug: None
Test: builds
Change-Id: Id09d74d8b876aaaa9ac16068ad52b0a0f2f57e67
diff --git a/net/netlink_manager.cpp b/net/netlink_manager.cpp
index e7e10ae..f9c8997 100644
--- a/net/netlink_manager.cpp
+++ b/net/netlink_manager.cpp
@@ -306,7 +306,7 @@
message_handlers_.erase(sequence);
return false;
} else if (poll_return == -1) {
- LOG(ERROR) << "Failed to poll netlink fd: " << strerror(errno);
+ PLOG(ERROR) << "Failed to poll netlink fd";
message_handlers_.erase(sequence);
return false;
}
@@ -390,7 +390,7 @@
ssize_t bytes_sent =
TEMP_FAILURE_RETRY(send(fd, data.data(), data.size(), 0));
if (bytes_sent == -1) {
- LOG(ERROR) << "Failed to send netlink message: " << strerror(errno);
+ PLOG(ERROR) << "Failed to send netlink message";
return false;
}
return true;
@@ -405,7 +405,7 @@
netlink_fd->reset(
socket(PF_NETLINK, SOCK_DGRAM | SOCK_CLOEXEC, NETLINK_GENERIC));
if (netlink_fd->get() < 0) {
- LOG(ERROR) << "Failed to create netlink socket: " << strerror(errno);
+ PLOG(ERROR) << "Failed to create netlink socket";
return false;
}
// Set maximum receive buffer size.
@@ -415,13 +415,13 @@
SO_RCVBUFFORCE,
&kReceiveBufferSize,
sizeof(kReceiveBufferSize)) < 0) {
- LOG(ERROR) << "Failed to set uevent socket SO_RCVBUFFORCE option: " << strerror(errno);
+ PLOG(ERROR) << "Failed to set uevent socket SO_RCVBUFFORCE option";
return false;
}
if (bind(netlink_fd->get(),
reinterpret_cast<struct sockaddr*>(&nladdr),
sizeof(nladdr)) < 0) {
- LOG(ERROR) << "Failed to bind netlink socket: " << strerror(errno);
+ PLOG(ERROR) << "Failed to bind netlink socket";
return false;
}
return true;
@@ -477,7 +477,7 @@
&group_id,
sizeof(group_id));
if (err < 0) {
- LOG(ERROR) << "Failed to setsockopt: " << strerror(errno);
+ PLOG(ERROR) << "Failed to setsockopt";
return false;
}
return true;
diff --git a/tests/looper_backed_event_loop_unittest.cpp b/tests/looper_backed_event_loop_unittest.cpp
index f28ba97..e258d5b 100644
--- a/tests/looper_backed_event_loop_unittest.cpp
+++ b/tests/looper_backed_event_loop_unittest.cpp
@@ -47,7 +47,7 @@
bool writeSignal() {
ssize_t n_written = ::write(send_fd, "*", 1);
if (n_written != 1) {
- LOG(ERROR) << "Failed to write signal to pipe: " << strerror(errno);
+ PLOG(ERROR) << "Failed to write signal to pipe";
return false;
}
return true;
@@ -60,7 +60,7 @@
if (n_read == 0) {
LOG(ERROR) << "No data from pipe";
} else {
- LOG(ERROR) << "Failed to read signal from pipe: " << strerror(errno);
+ PLOG(ERROR) << "Failed to read signal from pipe";
}
return false;
}
diff --git a/tests/shell_utils.cpp b/tests/shell_utils.cpp
index 5ab9ed0..5218782 100644
--- a/tests/shell_utils.cpp
+++ b/tests/shell_utils.cpp
@@ -77,7 +77,7 @@
write_fd.reset();
// Note that we're keeping parent stderr.
execl(kShellPath, "sh", "-c", shell_command.c_str(), nullptr);
- LOG(FATAL) << "exec() of child failed " << strerror(errno);
+ PLOG(FATAL) << "exec() of child failed";
}
// We are in the parent process.
@@ -115,8 +115,7 @@
if (waitpid_ret == 0) {
waitpid_ret = waitpid(child_pid, &wait_status, WNOHANG);
if (waitpid_ret == -1) {
- LOG(ERROR) << "waitpid() returned -1 on error(" << errno << "): "
- << strerror(errno);
+ PLOG(ERROR) << "waitpid() failed";
}
}
return waitpid_ret == 0;
@@ -133,7 +132,7 @@
// Allow kill to fail with ESRCH, since it indicated that the child may
// have already died.
if (kill_ret != 0 && errno != ESRCH) {
- LOG(ERROR) << "Failed to send signal to child: " << strerror(errno);
+ PLOG(ERROR) << "Failed to send signal to child";
}
// Wait for the child to die after receiving that signal.