diff options
author | Josh Gao <jmgao@google.com> | 2018-07-25 17:21:49 -0700 |
---|---|---|
committer | Josh Gao <jmgao@google.com> | 2018-07-25 18:49:37 -0700 |
commit | fa3107e2477de7b7554816ac5e2edeeef058e1b6 (patch) | |
tree | d07cb6886f12b3ef7696b79a157e5df2dabea2be /adb.h | |
parent | d8d51f4fc05fe76d463812be51916ad786570f02 (diff) | |
download | adb-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.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); |