diff options
Diffstat (limited to 'adb/adb_auth_client.cpp')
-rw-r--r-- | adb/adb_auth_client.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/adb/adb_auth_client.cpp b/adb/adb_auth_client.cpp index deb0a5d..5dadcd9 100644 --- a/adb/adb_auth_client.cpp +++ b/adb/adb_auth_client.cpp @@ -249,19 +249,23 @@ static void adb_auth_listener(int fd, unsigned events, void *data) } } -void adb_auth_init(void) -{ - int fd, ret; - - fd = android_get_control_socket("adbd"); - if (fd < 0) { +void adbd_cloexec_auth_socket() { + int fd = android_get_control_socket("adbd"); + if (fd == -1) { D("Failed to get adbd socket\n"); return; } fcntl(fd, F_SETFD, FD_CLOEXEC); +} - ret = listen(fd, 4); - if (ret < 0) { +void adbd_auth_init(void) { + int fd = android_get_control_socket("adbd"); + if (fd == -1) { + D("Failed to get adbd socket\n"); + return; + } + + if (listen(fd, 4) == -1) { D("Failed to listen on '%d'\n", fd); return; } |