Lines Matching refs:sock
36 static int do_monitor(int sock, int stop_after_cmd);
37 static int do_cmd(int sock, int argc, char **argv);
40 int sock; in main() local
57 while ((sock = socket_local_client("vold", in main()
69 exit(do_monitor(sock, 0)); in main()
71 exit(do_cmd(sock, argc, argv)); in main()
75 static int do_cmd(int sock, int argc, char **argv) { in do_cmd() argument
94 if (write(sock, final_cmd, strlen(final_cmd) + 1) < 0) { in do_cmd()
99 return do_monitor(sock, 1); in do_cmd()
102 static int do_monitor(int sock, int stop_after_cmd) { in do_monitor() argument
117 FD_SET(sock, &read_fds); in do_monitor()
119 if ((rc = select(sock +1, &read_fds, NULL, NULL, &to)) < 0) { in do_monitor()
127 } else if (FD_ISSET(sock, &read_fds)) { in do_monitor()
129 if ((rc = read(sock, buffer, 4096)) <= 0) { in do_monitor()