diff options
author | Elliott Hughes <enh@google.com> | 2015-10-07 14:55:10 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2015-10-07 15:35:18 -0700 |
commit | eaa93c18ba1c011666035f183bcc059876af0bd3 (patch) | |
tree | 47bb24231f7277f45afa1b3c98a773b0e982a94d /adb_client.cpp | |
parent | a4134f1d71cdb334d1fe4c3c9bbf1d36dc798059 (diff) | |
download | adb-eaa93c18ba1c011666035f183bcc059876af0bd3.tar.gz |
Fix adb -d/-e error reporting.
If -d/-e fail, get-serialno and friends will now report an error
and return a failure status code on exit.
Also fix the behavior of -d/-e with $ANDROID_SERIAL --- -d/-e
should override $ANDROID_SERIAL, not the other way round.
I'm deleting my own comment here about always returning "unknown"
for scripts. I can't find any evidence that there are scripts
relying on that, so I think my comment meant "I fear that there
are scripts doing so".
Bug: http://b/24403699
Change-Id: Ie13a751f1137abcfe0cc6c46a0630ba5e02db676
Diffstat (limited to 'adb_client.cpp')
-rw-r--r-- | adb_client.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/adb_client.cpp b/adb_client.cpp index 984910d..fa8ce9e 100644 --- a/adb_client.cpp +++ b/adb_client.cpp @@ -209,9 +209,8 @@ int adb_connect(const std::string& service, std::string* error) { adb_close(fd); if (sscanf(&version_string[0], "%04x", &version) != 1) { - *error = android::base::StringPrintf( - "cannot parse version string: %s", - version_string.c_str()); + *error = android::base::StringPrintf("cannot parse version string: %s", + version_string.c_str()); return -1; } } else { |