logd: fix write errors in no_epipe test
This length needs to contain the length of '\0' when writing
string to socket.
Bug: 195717127
Test: run CtsLogdTestCases pass
Change-Id: Ide95656d012d97511c57a4a7cdabcc12a5c33727
(cherry picked from commit 2bb97ecd62c385465d2375bc62a1675d8c838e35)
diff --git a/logd/logd_test.cpp b/logd/logd_test.cpp
index ec09cd7..be9c91e 100644
--- a/logd/logd_test.cpp
+++ b/logd/logd_test.cpp
@@ -856,9 +856,9 @@
std::string message = "getStatistics 0 1 2 3 4 5 6 7";
- ASSERT_GT(write(sock1, message.c_str(), message.length()), 0);
+ ASSERT_GT(write(sock1, message.c_str(), message.length() + 1), 0);
sock1.reset();
- ASSERT_GT(write(sock2, message.c_str(), message.length()), 0);
+ ASSERT_GT(write(sock2, message.c_str(), message.length() + 1), 0);
struct pollfd p = {.fd = sock2, .events = POLLIN, .revents = 0};