diff options
author | Elliott Hughes <enh@google.com> | 2015-04-16 22:54:44 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2015-04-16 22:54:44 -0700 |
commit | 7be29c819b4fb8bf9b1d4b69a4333f8765de0281 (patch) | |
tree | 8d5b1c0328310782acd5c735e9a42ecff24f49a3 /adb/adb.cpp | |
parent | a4802ca08bfcbf0124f5e9b959ed4e3a198d5f46 (diff) | |
download | system_core-7be29c819b4fb8bf9b1d4b69a4333f8765de0281.zip system_core-7be29c819b4fb8bf9b1d4b69a4333f8765de0281.tar.gz system_core-7be29c819b4fb8bf9b1d4b69a4333f8765de0281.tar.bz2 |
Show $ADB_VENDOR_KEYS if authentication fails.
Incorrectly set $ADB_VENDOR_KEYS is the most likely cause of failed
adb connections. Make it easier to debug such problems by including
the value in use in the error message.
Bug: 20165551
Change-Id: I64c1d98ae6d3fb40eea9e1f0ddcfcf4f2d9d7318
Diffstat (limited to 'adb/adb.cpp')
-rw-r--r-- | adb/adb.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/adb/adb.cpp b/adb/adb.cpp index ad85184..b09e853 100644 --- a/adb/adb.cpp +++ b/adb/adb.cpp @@ -838,10 +838,10 @@ int handle_forward_request(const char* service, transport_type ttype, char* seri } } - const char* err; - transport = acquire_one_transport(CS_ANY, ttype, serial, &err); + std::string error_msg; + transport = acquire_one_transport(CS_ANY, ttype, serial, &error_msg); if (!transport) { - sendfailmsg(reply_fd, err); + sendfailmsg(reply_fd, error_msg.c_str()); return 1; } @@ -910,14 +910,14 @@ int handle_host_request(char *service, transport_type ttype, char* serial, int r serial = service; } - const char* error_string = "unknown failure"; - transport = acquire_one_transport(CS_ANY, type, serial, &error_string); + std::string error_msg = "unknown failure"; + transport = acquire_one_transport(CS_ANY, type, serial, &error_msg); if (transport) { s->transport = transport; adb_write(reply_fd, "OKAY", 4); } else { - sendfailmsg(reply_fd, error_string); + sendfailmsg(reply_fd, error_msg.c_str()); } return 1; } @@ -975,7 +975,7 @@ int handle_host_request(char *service, transport_type ttype, char* serial, int r if(!strncmp(service,"get-serialno",strlen("get-serialno"))) { const char *out = "unknown"; transport = acquire_one_transport(CS_ANY, ttype, serial, NULL); - if (transport && transport->serial) { + if (transport && transport->serial) { out = transport->serial; } send_msg_with_okay(reply_fd, out, strlen(out)); @@ -984,7 +984,7 @@ int handle_host_request(char *service, transport_type ttype, char* serial, int r if(!strncmp(service,"get-devpath",strlen("get-devpath"))) { const char *out = "unknown"; transport = acquire_one_transport(CS_ANY, ttype, serial, NULL); - if (transport && transport->devpath) { + if (transport && transport->devpath) { out = transport->devpath; } send_msg_with_okay(reply_fd, out, strlen(out)); |