• Home
  • Raw
  • Download

Lines Matching refs:fd

50     void (*func)(int fd, void *cookie);
51 int fd; member
59 sti->func(sti->fd, sti->cookie); in service_bootstrap_func()
66 void restart_root_service(int fd, void *cookie) { in restart_root_service() argument
68 WriteFdExactly(fd, "adbd is already running as root\n"); in restart_root_service()
69 adb_close(fd); in restart_root_service()
74 WriteFdExactly(fd, "adbd cannot run as root in production builds\n"); in restart_root_service()
75 adb_close(fd); in restart_root_service()
80 WriteFdExactly(fd, "restarting adbd as root\n"); in restart_root_service()
81 adb_close(fd); in restart_root_service()
85 void restart_unroot_service(int fd, void *cookie) { in restart_unroot_service() argument
87 WriteFdExactly(fd, "adbd not running as root\n"); in restart_unroot_service()
88 adb_close(fd); in restart_unroot_service()
91 WriteFdExactly(fd, "restarting adbd as non root\n"); in restart_unroot_service()
92 adb_close(fd); in restart_unroot_service()
96 void restart_tcp_service(int fd, void *cookie) { in restart_tcp_service() argument
99 WriteFdFmt(fd, "invalid port %d\n", port); in restart_tcp_service()
100 adb_close(fd); in restart_tcp_service()
107 WriteFdFmt(fd, "restarting in TCP mode port: %d\n", port); in restart_tcp_service()
108 adb_close(fd); in restart_tcp_service()
111 void restart_usb_service(int fd, void *cookie) { in restart_usb_service() argument
113 WriteFdExactly(fd, "restarting in USB mode\n"); in restart_usb_service()
114 adb_close(fd); in restart_usb_service()
117 static bool reboot_service_impl(int fd, const char* arg) { in reboot_service_impl() argument
130 WriteFdExactly(fd, "'adb root' is required for 'adb reboot sideload'.\n"); in reboot_service_impl()
156 WriteFdFmt(fd, "reboot string too long: %d\n", ret); in reboot_service_impl()
162 WriteFdFmt(fd, "reboot failed: %d\n", ret); in reboot_service_impl()
169 void reboot_service(int fd, void* arg) in reboot_service() argument
171 if (reboot_service_impl(fd, static_cast<const char*>(arg))) { in reboot_service()
180 adb_close(fd); in reboot_service()
183 void reverse_service(int fd, void* arg) in reverse_service() argument
187 if (handle_forward_request(command, kTransportAny, NULL, fd) < 0) { in reverse_service()
188 SendFail(fd, "not a reverse forwarding command"); in reverse_service()
191 adb_close(fd); in reverse_service()
211 sti->fd = s[1]; in create_service_thread()
233 int fd = adb_open("/proc/self/oom_score_adj", O_WRONLY | O_CLOEXEC); in init_subproc_child() local
234 if (fd >= 0) { in init_subproc_child()
235 adb_write(fd, "0", 1); in init_subproc_child()
236 adb_close(fd); in init_subproc_child()
350 static void subproc_waiter_service(int fd, void *cookie) in subproc_waiter_service() argument
354 D("entered. fd=%d of pid=%d\n", fd, pid); in subproc_waiter_service()
359 D("fd=%d, post waitpid(pid=%d) status=%04x\n", fd, p, status); in subproc_waiter_service()
372 D("shell exited fd=%d of pid=%d err=%d\n", fd, pid, errno); in subproc_waiter_service()
375 res = WriteFdExactly(SHELL_EXIT_NOTIFY_FD, &fd, sizeof(fd)) ? 0 : -1; in subproc_waiter_service()
411 sti->fd = ret_fd; in create_subproc_thread()
522 static void wait_for_state(int fd, void* cookie) in wait_for_state() argument
531 SendOkay(fd); in wait_for_state()
533 SendFail(fd, error_msg); in wait_for_state()
539 adb_close(fd); in wait_for_state()
564 int fd = socket_network_client_timeout(hostname.c_str(), port, SOCK_STREAM, 10); in connect_device() local
565 if (fd < 0) { in connect_device()
571 D("client: connected on remote on fd %d\n", fd); in connect_device()
572 close_on_exec(fd); in connect_device()
573 disable_tcp_nagle(fd); in connect_device()
575 int ret = register_socket_transport(fd, serial.c_str(), port, 0); in connect_device()
577 adb_close(fd); in connect_device()
630 static void connect_service(int fd, void* cookie) in connect_service() argument
642 SendProtocolString(fd, response); in connect_service()
643 adb_close(fd); in connect_service()
680 int fd = create_service_thread(wait_for_state, sinfo); in host_service_to_socket() local
681 return create_local_socket(fd); in host_service_to_socket()
684 int fd = create_service_thread(connect_service, (void *)host); in host_service_to_socket() local
685 return create_local_socket(fd); in host_service_to_socket()