Lines Matching defs:fd
46 int fd;
53 int fd;
59 if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) {
64 if (connect(fd, (struct sockaddr *)&sun, sizeof(sun)) == 0) {
66 close(fd);
70 close(fd);
79 int fd;
82 if ((fd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC | SOCK_NONBLOCK,
95 close(fd);
100 if (bind(fd, (struct sockaddr *)&sun, sizeof(sun)) == -1) {
102 close(fd);
110 close(fd);
115 return (fd);
119 control_listen(int fd)
121 control_state.fd = fd;
123 if (listen(control_state.fd, CONTROL_BACKLOG) == -1) {
128 event_set(&control_state.ev, control_state.fd, EV_READ,
187 event_set(&c->iev.ev, c->iev.ibuf.fd, c->iev.events,
195 control_connbyfd(int fd)
200 if (c->iev.ibuf.fd == fd)
221 control_close(int fd)
225 if ((c = control_connbyfd(fd)) == NULL) {
226 log_warn("control_close: fd %d: not found", fd);
234 close(c->iev.ibuf.fd);
246 control_dispatch_imsg(int fd, short event, void *bula)
254 if ((c = control_connbyfd(fd)) == NULL) {
255 log_warn("control_dispatch_imsg: fd %d: not found", fd);
261 control_close(fd);
267 control_close(fd);
274 control_close(fd);