Home | History | Annotate | Download | only in netd

Lines Matching defs: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;
47 if ((sock = socket_local_client(argv[1],
50 if ((sock = socket_local_client("netd",
63 exit(do_monitor(sock, 0));
64 exit(do_cmd(sock, argc-cmdOffset, &(argv[cmdOffset])));
67 static int do_cmd(int sock, int argc, char **argv) {
83 if (write(sock, final_cmd, strlen(final_cmd) + 1) < 0) {
88 return do_monitor(sock, 1);
91 static int do_monitor(int sock, int stop_after_cmd) {
106 FD_SET(sock, &read_fds);
108 if ((rc = select(sock +1, &read_fds, NULL, NULL, &to)) < 0) {
116 } else if (FD_ISSET(sock, &read_fds)) {
118 if ((rc = read(sock, buffer, 4096)) <= 0) {