summaryrefslogtreecommitdiffstats
path: root/adb
diff options
context:
space:
mode:
authorJosh Gao <jmgao@google.com>2016-02-24 15:16:17 -0800
committerJosh Gao <jmgao@google.com>2016-02-24 15:22:14 -0800
commitf56c39194f1c2a4f0ea5d2ac20aebf80de4b0ae7 (patch)
treee67aaa4034ecd36cccf01ccaa56e5cf2773065f3 /adb
parent44b08c722d05f650c9b6872e28c73affe68eb55a (diff)
downloadcore-f56c39194f1c2a4f0ea5d2ac20aebf80de4b0ae7.tar.gz
core-f56c39194f1c2a4f0ea5d2ac20aebf80de4b0ae7.tar.bz2
core-f56c39194f1c2a4f0ea5d2ac20aebf80de4b0ae7.zip
adb: bail out if wait_for_device fails in send_shell_command.
Bug: http://b/27166186 Change-Id: Ib7e9d7e6b909d67a3af94c3517a6a0b54cf17db7
Diffstat (limited to 'adb')
-rw-r--r--adb/commandline.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/adb/commandline.cpp b/adb/commandline.cpp
index 8e76168cb..37d114605 100644
--- a/adb/commandline.cpp
+++ b/adb/commandline.cpp
@@ -1106,8 +1106,9 @@ static int send_shell_command(TransportType transport_type, const char* serial,
}
fprintf(stderr,"- waiting for device -\n");
- adb_sleep_ms(1000);
- wait_for_device("wait-for-device", transport_type, serial);
+ if (!wait_for_device("wait-for-device", transport_type, serial)) {
+ return 1;
+ }
}
int exit_code = read_and_dump(fd, use_shell_protocol);