Lines Matching refs:fd

624         int fd;
627 fd = adb_socket_accept(_fd, &addr, &alen);
628 if(fd < 0) return;
630 adb_socket_setbufsize(fd, CHUNK_SIZE);
632 s = create_local_socket(fd);
638 adb_close(fd);
650 int fd;
653 fd = adb_socket_accept(_fd, &addr, &alen);
654 if(fd < 0) return;
656 s = create_local_socket(fd);
663 adb_close(fd);
675 // closes the corresponding fd
779 l->fd = local_name_to_fd(local_name);
780 if(l->fd < 0) {
788 close_on_exec(l->fd);
790 fdevent_install(&l->fde, l->fd, ss_listener_event_func, l);
792 fdevent_install(&l->fde, l->fd, listener_event_func, l);
852 int fd;
854 fd = unix_open("/dev/null", O_RDONLY);
855 dup2(fd, 0);
856 adb_close(fd);
858 fd = unix_open("/tmp/adb.log", O_WRONLY | O_CREAT | O_APPEND, 0640);
859 if(fd < 0) {
860 fd = unix_open("/dev/null", O_WRONLY);
862 dup2(fd, 1);
863 dup2(fd, 2);
864 adb_close(fd);
872 int fd;
891 fd = unix_open(path, O_WRONLY | O_CREAT | O_TRUNC, 0640);
892 if (fd < 0)
896 dup2(fd, 1);
897 dup2(fd, 2);
899 adb_close(fd);
901 fd = unix_open("/dev/null", O_RDONLY);
902 dup2(fd, 0);
903 adb_close(fd);
990 int fd[2];
993 // fd[0] will be parent's end, and fd[1] will get mapped to stderr in the child.
994 if (pipe(fd)) {
1007 adb_close(fd[0]);
1008 dup2(fd[1], STDERR_FILENO);
1009 adb_close(fd[1]);
1022 adb_close(fd[1]);
1023 int ret = adb_read(fd[0], temp, 3);
1025 adb_close(fd[0]);
1239 int port, fd;
1266 fd = socket_network_client(hostbuf, port, SOCK_STREAM);
1267 if (fd < 0) {
1272 D("client: connected on remote on fd %d\n", fd);
1273 close_on_exec(fd);
1274 disable_tcp_nagle(fd);
1275 register_socket_transport(fd, serial, port, 0);