EINTR is handled by adb_read/unix_read and friends.
No need to clutter the code with cases that won't happen.
Change-Id: I47c5a2e6170f902d2618719f44492234a4869567
diff --git a/adb/commandline.cpp b/adb/commandline.cpp
index e1e21ed..b92757f 100644
--- a/adb/commandline.cpp
+++ b/adb/commandline.cpp
@@ -276,10 +276,7 @@
count--;
while (count > 0) {
int len = adb_read(fd, buf, count);
- if (len == 0) {
- break;
- } else if (len < 0) {
- if (errno == EINTR) continue;
+ if (len <= 0) {
break;
}
@@ -332,11 +329,7 @@
break;
}
if (len < 0) {
- if (errno == EINTR) {
- D("copy_to_file() : EINTR, retrying\n");
- continue;
- }
- D("copy_to_file() : error %d\n", errno);
+ D("copy_to_file(): read failed: %s\n", strerror(errno));
break;
}
if (outFd == STDOUT_FILENO) {
@@ -386,12 +379,8 @@
D("stdin_read_thread(): pre unix_read(fdi=%d,...)\n", fdi);
r = unix_read(fdi, buf, 1024);
D("stdin_read_thread(): post unix_read(fdi=%d,...)\n", fdi);
- if(r == 0) break;
- if(r < 0) {
- if(errno == EINTR) continue;
- break;
- }
- for(n = 0; n < r; n++){
+ if (r <= 0) break;
+ for (n = 0; n < r; n++){
switch(buf[n]) {
case '\n':
state = 1;