adb: Don't allow a forced exit if data is still in the socket


Fixes the  http://b/4271011 "adb shell cat /init.rc output gets truncated"


Change-Id: I6df64374b60789595fb18f96d429315dec032443
Signed-off-by: JP Abgrall <jpa@google.com>
diff --git a/adb/sockets.c b/adb/sockets.c
index c3c4ac2..45d935c 100644
--- a/adb/sockets.c
+++ b/adb/sockets.c
@@ -360,8 +360,8 @@
                 fdevent_del(&s->fde, FDE_READ);
             }
         }
-
-        if(s->fde.force_eof || is_eof) {
+        /* Don't allow a forced eof if data is still there */
+        if((s->fde.force_eof && !r) || is_eof) {
             s->close(s);
         }
     }