fix for adbd pinning CPU
adbd was spinning between select & read (0 bytes) for an adb_auth
socket. The read documentation states: "On success, the number of
bytes read is returned (zero indicates end of file)" so the code has
been modified to close the connection (like the read error case).
BUG=17419868
Change-Id: I1d8fb70c8e1876225ba8d47ea0a2b6265a7d182b
diff --git a/adb/adb_auth_client.c b/adb/adb_auth_client.c
index 8409c63..55e9dca 100644
--- a/adb/adb_auth_client.c
+++ b/adb/adb_auth_client.c
@@ -175,7 +175,7 @@
if (events & FDE_READ) {
ret = unix_read(fd, response, sizeof(response));
- if (ret < 0) {
+ if (ret <= 0) {
D("Framework disconnect\n");
if (usb_transport)
fdevent_remove(&usb_transport->auth_fde);