Home | History | Annotate | Download | only in netd

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;
44 if ((sock = socket_local_client("netd",
52 exit(do_monitor(sock, 0));
53 exit(do_cmd(sock, argc, argv));
56 static int do_cmd(int sock, int argc, char **argv) {
72 if (write(sock, final_cmd, strlen(final_cmd) + 1) < 0) {
77 return do_monitor(sock, 1);
80 static int do_monitor(int sock, int stop_after_cmd) {
95 FD_SET(sock, &read_fds);
97 if ((rc = select(sock +1, &read_fds, NULL, NULL, &to)) < 0) {
105 } else if (FD_ISSET(sock, &read_fds)) {
107 if ((rc = read(sock, buffer, 4096)) <= 0) {