summaryrefslogtreecommitdiff
path: root/client/NetdClientTest.cpp
diff options
context:
space:
mode:
authorLuke Huang <huangluke@google.com>2019-06-04 01:33:14 +0800
committerLuke Huang <huangluke@google.com>2019-06-05 02:15:12 +0000
commit76577c6cf16d46af4edec237349cd72052beb470 (patch)
treeab8805cf54d4f955b7ed87b5a63ca58eb527975d /client/NetdClientTest.cpp
parent3cb91bce0807c1d01da3e67a7979415dfc817a82 (diff)
Fix netclient test and add it to test mapping
Bug: 134356964 Test: atest netdclient_test cd system/netd && atest Change-Id: I1519e541c1018ac1be51467397c40d075ed7b4b6
Diffstat (limited to 'client/NetdClientTest.cpp')
-rw-r--r--client/NetdClientTest.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/client/NetdClientTest.cpp b/client/NetdClientTest.cpp
index 6f2fc09d..b523ccc9 100644
--- a/client/NetdClientTest.cpp
+++ b/client/NetdClientTest.cpp
@@ -36,9 +36,10 @@ void serverLoop(int dnsProxyFd) {
pollfd fds[1] = {{.fd = dnsProxyFd, .events = POLLIN}};
enum { SERVERFD = 0 };
- const int s = TEMP_FAILURE_RETRY(poll(fds, std::size(fds), -1));
- if (s <= 0) break;
+ int poll_result = TEMP_FAILURE_RETRY(poll(fds, std::size(fds), -1));
+ ASSERT_GT(poll_result, 0);
+ if (fds[SERVERFD].revents & POLLERR) return;
if (fds[SERVERFD].revents & POLLIN) {
char buf[4096];
TEMP_FAILURE_RETRY(read(fds[SERVERFD].fd, &buf, sizeof(buf)));