From af436b1e10bed3b89880b3bd4f3031ea14057def Mon Sep 17 00:00:00 2001 From: Vince Harron Date: Thu, 25 Sep 2014 21:51:15 -0700 Subject: [PATCH] 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 --- adb/adb_auth_client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adb/adb_auth_client.c b/adb/adb_auth_client.c index 8409c6339..55e9dcad1 100644 --- a/adb/adb_auth_client.c +++ b/adb/adb_auth_client.c @@ -175,7 +175,7 @@ static void adb_auth_event(int fd, unsigned events, void *data) 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);