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
This commit is contained in:
Vince Harron 2014-09-25 21:51:15 -07:00
parent 8dd3ea58fd
commit af436b1e10
1 changed files with 1 additions and 1 deletions

View File

@ -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);