Lines Matching defs:fd
47 int fd;
48 } control_state = {.fd = -1};
65 int fd;
68 if ((fd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC | SOCK_NONBLOCK,
81 close(fd);
86 if (bind(fd, (struct sockaddr *)&sun, sizeof(sun)) == -1) {
88 close(fd);
96 close(fd);
101 return (fd);
105 control_listen(int fd)
107 if (control_state.fd != -1)
110 control_state.fd = fd;
111 if (listen(control_state.fd, CONTROL_BACKLOG) == -1) {
116 event_set(&control_state.ev, control_state.fd, EV_READ,
168 event_set(&c->iev.ev, c->iev.ibuf.fd, c->iev.events,
176 control_connbyfd(int fd)
181 if (c->iev.ibuf.fd == fd)
202 control_close(int fd)
206 if ((c = control_connbyfd(fd)) == NULL) {
207 log_warnx("%s: fd %d: not found", __func__, fd);
215 close(c->iev.ibuf.fd);
227 control_dispatch_imsg(int fd, short event, void *bula)
236 if ((c = control_connbyfd(fd)) == NULL) {
237 log_warnx("%s: fd %d: not found", __func__, fd);
243 control_close(fd);
249 control_close(fd);
256 control_close(fd);