aboutsummaryrefslogtreecommitdiff
path: root/adb.h
diff options
context:
space:
mode:
authorJosh Gao <jmgao@google.com>2018-07-25 17:21:49 -0700
committerJosh Gao <jmgao@google.com>2018-07-25 18:49:37 -0700
commitfa3107e2477de7b7554816ac5e2edeeef058e1b6 (patch)
treed07cb6886f12b3ef7696b79a157e5df2dabea2be /adb.h
parentd8d51f4fc05fe76d463812be51916ad786570f02 (diff)
downloadadb-fa3107e2477de7b7554816ac5e2edeeef058e1b6.tar.gz
adb: fix register_socket_transport related double-closes.
Multiple codepaths were closing the fd they passed into register_socket_transport on failure, which would close the fd itself. Switch things over to unique_fd to make it clear that we don't actually have to close on failure. Test: mma Change-Id: I2d9bdcb1142c24931d970f99ebdf9a8051daf05c
Diffstat (limited to 'adb.h')
-rw-r--r--adb.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/adb.h b/adb.h
index 7e9af9e3..26b5fa14 100644
--- a/adb.h
+++ b/adb.h
@@ -133,7 +133,7 @@ int launch_server(const std::string& socket_spec);
int adb_server_main(int is_daemon, const std::string& socket_spec, int ack_reply_fd);
/* initialize a transport object's func pointers and state */
-int init_socket_transport(atransport* t, int s, int port, int local);
+int init_socket_transport(atransport* t, unique_fd s, int port, int local);
void init_usb_transport(atransport* t, usb_handle* usb);
std::string getEmulatorSerialString(int console_port);