From eaa93c18ba1c011666035f183bcc059876af0bd3 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 7 Oct 2015 14:55:10 -0700 Subject: 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 --- adb_client.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'adb_client.cpp') 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 { -- cgit v1.2.3