Lines Matching refs:sock
35 static int do_monitor(int sock, int stop_after_cmd);
36 static int do_cmd(int sock, int argc, char **argv);
39 int sock; in main() local
47 if ((sock = socket_local_client(argv[1], in main()
50 if ((sock = socket_local_client("netd", in main()
63 exit(do_monitor(sock, 0)); in main()
64 exit(do_cmd(sock, argc-cmdOffset, &(argv[cmdOffset]))); in main()
67 static int do_cmd(int sock, int argc, char **argv) { in do_cmd() argument
106 if (write(sock, final_cmd, strlen(final_cmd) + 1) < 0) { in do_cmd()
114 return do_monitor(sock, 1); in do_cmd()
117 static int do_monitor(int sock, int stop_after_cmd) { in do_monitor() argument
132 FD_SET(sock, &read_fds); in do_monitor()
134 if ((rc = select(sock +1, &read_fds, NULL, NULL, &to)) < 0) { in do_monitor()
143 } else if (FD_ISSET(sock, &read_fds)) { in do_monitor()
145 if ((rc = read(sock, buffer, 4096)) <= 0) { in do_monitor()