Lines Matching refs:fd
45 static int fd = -1; variable
59 close(l->fd); in remove_control_data()
60 delete_event(l->fd); in remove_control_data()
81 bytes = read(l->fd, buffer, sizeof(buffer) - 1); in handle_control_data()
109 if ((f = accept(fd, (struct sockaddr *)&run, &len)) == -1) in handle_control()
112 l->fd = f; in handle_control()
116 add_event(l->fd, handle_control_data, l); in handle_control()
122 if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) in make_sock()
138 if (bind(fd, (struct sockaddr *)&sun, len) == -1 || in start_control()
141 set_cloexec(fd) == -1 || in start_control()
142 set_nonblock(fd) == -1 || in start_control()
143 listen(fd, sizeof(fds)) == -1) in start_control()
145 close(fd); in start_control()
148 add_event(fd, handle_control, NULL); in start_control()
149 return fd; in start_control()
158 delete_event(fd); in stop_control()
159 if (shutdown(fd, SHUT_RDWR) == -1) in stop_control()
161 fd = -1; in stop_control()
168 delete_event(l->fd); in stop_control()
169 shutdown(l->fd, SHUT_RDWR); in stop_control()
184 return connect(fd, (struct sockaddr *)&sun, len); in open_control()
207 return write(fd, buffer, p - buffer); in send_control()