Lines Matching refs:fd

203 static void stdin_raw_init(int fd)
207 if(tcgetattr(fd, &tio)) return;
208 if(tcgetattr(fd, &tio_save)) return;
216 tcsetattr(fd, TCSANOW, &tio);
217 tcflush(fd, TCIFLUSH);
220 static void stdin_raw_restore(int fd)
222 tcsetattr(fd, TCSANOW, &tio_save);
223 tcflush(fd, TCIFLUSH);
227 static void read_and_dump(int fd)
232 while(fd >= 0) {
233 D("read_and_dump(): pre adb_read(fd=%d)\n", fd);
234 len = adb_read(fd, buf, 4096);
235 D("read_and_dump(): post adb_read(fd=%d): len=%d\n", fd, len);
279 int fd, fdi;
285 fd = fds[0];
322 r = adb_write(fd, buf, r);
333 int fdi, fd;
336 fd = adb_connect("shell:");
337 if(fd < 0) {
344 fds[0] = fd;
351 read_and_dump(fd);
379 int fd;
383 fd = adb_connect(buf);
384 if(fd < 0) {
390 opt = setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &opt, sizeof(opt));
402 if(writex(fd, ptr, xfer)) {
403 adb_status(fd);
418 if(readx(fd, buf, 4)){
420 adb_close(fd);
426 adb_close(fd);
430 adb_close(fd);
461 int fd;
462 fd = unix_open("/dev/null", O_WRONLY);
463 dup2(fd, 2);
464 adb_close(fd);
548 int fd;
559 fd = adb_connect(adb_service_name);
561 if(fd < 0) {
588 dup2(fd, STDIN_FILENO);
589 dup2(fd, STDOUT_FILENO);
591 adb_close(fd);
602 adb_close(fd);
610 int fd, ret;
613 fd = adb_connect(buf);
614 if(fd >= 0)
621 read_and_dump(fd);
622 ret = adb_close(fd);
688 int fd, outFd;
725 fd = adb_connect(buf);
726 if (fd < 0) {
733 copy_to_file(fd, outFd);
735 adb_close(fd);
742 int fd, tarFd;
753 fd = adb_connect("restore:");
754 if (fd < 0) {
761 copy_to_file(tarFd, fd);
763 adb_close(fd);
1083 int fd;
1119 fd = adb_connect(buf);
1120 if(fd >= 0) {
1121 D("about to read_and_dump(fd=%d)\n", fd);
1122 read_and_dump(fd);
1124 adb_close(fd);
1147 int fd;
1148 fd = _adb_connect("host:kill");
1149 if(fd == -1) {
1176 int fd = adb_connect(command);
1177 if(fd >= 0) {
1178 read_and_dump(fd);
1179 adb_close(fd);
1355 int fd = adb_connect("jdwp");
1356 if (fd >= 0) {
1357 read_and_dump(fd);
1358 adb_close(fd);