From 82e69b2386f0844afa5020e1e8b5c6903e8725cc Mon Sep 17 00:00:00 2001 From: Michael Bestas Date: Sat, 9 Apr 2022 19:37:39 +0300 Subject: [PATCH] libsysutils: Hide NetlinkListener error in recovery * Prevents users from seeing this message in recovery: `E:recvmsg failed (No buffer space available)` * This is caused by volume_manager (our addition in recovery) and hiding this error does not seem to have any negative side effect. Change-Id: I0d65796961c3036289ed13c0b8949a27b5b97ad6 --- libsysutils/src/NetlinkListener.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libsysutils/src/NetlinkListener.cpp b/libsysutils/src/NetlinkListener.cpp index aad0394da..3dc2e4355 100644 --- a/libsysutils/src/NetlinkListener.cpp +++ b/libsysutils/src/NetlinkListener.cpp @@ -57,7 +57,11 @@ bool NetlinkListener::onDataAvailable(SocketClient *cli) count = TEMP_FAILURE_RETRY(uevent_kernel_recv(socket, mBuffer, sizeof(mBuffer), require_group, &uid)); if (count < 0) { +#ifdef __ANDROID_RECOVERY__ + SLOGW("recvmsg failed (%s)", strerror(errno)); +#else SLOGE("recvmsg failed (%s)", strerror(errno)); +#endif return false; }