diff options
author | Josh Gao <jmgao@google.com> | 2018-08-07 14:14:21 -0700 |
---|---|---|
committer | Josh Gao <jmgao@google.com> | 2018-08-07 14:24:36 -0700 |
commit | d3067475cbe7dedb38030e743dbf30e29f8a2a8f (patch) | |
tree | 43c67d9b2a29ec5b0d8c37857c440d396442f042 /adb.h | |
parent | 917fbb4a8b9c1a14797c771bf795a216855e61a3 (diff) | |
download | adb-d3067475cbe7dedb38030e743dbf30e29f8a2a8f.tar.gz |
adb: clean up handle_host_request.
Previously, we were returning the result of SendOkay/SendFail in a few
places after handling a host request, which is incorrect for two
reasons. First, the return type of SendOkay/SendFail is bool, and
handle_host_request was expected to return 0 on success. Second, we
don't care if the SendOkay fails; if we got to that point, we're done
with the request, regardless of whether we succeeded to report our
result. The result of this was a spurious failure result reported after
the initial result, which was ignored by the adb client.
Test: manually straced adb server
Test: python test_adb.py
Test: python test_device.py
Change-Id: I7d45ba527e1faccbbae5b15e7a0d1557b0a84858
Diffstat (limited to 'adb.h')
-rw-r--r-- | adb.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -210,8 +210,8 @@ extern const char* adb_device_banner; #define USB_FFS_ADB_IN USB_FFS_ADB_EP(ep2) #endif -int handle_host_request(const char* service, TransportType type, const char* serial, - TransportId transport_id, int reply_fd, asocket* s); +bool handle_host_request(const char* service, TransportType type, const char* serial, + TransportId transport_id, int reply_fd, asocket* s); void handle_online(atransport* t); void handle_offline(atransport* t); |