diff options
author | Shaju Mathew <shaju@google.com> | 2024-01-24 14:16:17 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2024-01-24 14:16:17 +0000 |
commit | 7806e425e18a48a0f9e580e381cdc86ed5478a4c (patch) | |
tree | f6c3a9d3705775392e2602f2e8aef34076419ea3 | |
parent | 59aced8cfc23c2707dba2e3b6efc8091520e569e (diff) | |
parent | fa64cc2ac06c4b93bd50a4cc7911dbee39360441 (diff) | |
download | adb-7806e425e18a48a0f9e580e381cdc86ed5478a4c.tar.gz |
Merge "Fix return code of `adb shell` when device disconnects" into main
-rw-r--r-- | client/commandline.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/client/commandline.cpp b/client/commandline.cpp index 781c6d5a..c918950d 100644 --- a/client/commandline.cpp +++ b/client/commandline.cpp @@ -288,7 +288,8 @@ static void stdin_raw_restore() { #endif int read_and_dump_protocol(borrowed_fd fd, StandardStreamsCallbackInterface* callback) { - int exit_code = 0; + // OpenSSH returns 255 on unexpected disconnection. + int exit_code = 255; std::unique_ptr<ShellProtocol> protocol = std::make_unique<ShellProtocol>(fd); if (!protocol) { LOG(ERROR) << "failed to allocate memory for ShellProtocol object"; |