Lines Matching refs:n
75 size_t n = 0; in server_add_state() local
77 for (n = 0; n < srvst->nfds; n++) { in server_add_state()
78 if (srvst->fds[n].fd == -1) { in server_add_state()
79 srvst->socks[n].cb = cb; in server_add_state()
80 srvst->socks[n].serv = serv; in server_add_state()
81 srvst->fds[n].fd = fd; in server_add_state()
82 srvst->fds[n].events = poll_events; in server_add_state()
83 srvst->fds[n].revents = 0; in server_add_state()
160 size_t n = 0; in sock_server() local
165 for (n = 0; n < ts->num_binds; n++) { in sock_server()
166 if (!server_add_state(&srvst, cb, ts->bind + n, in sock_server()
167 ts->bind[n].fd, POLLIN)) in sock_server()
187 for (n = 0; pres && n < srvst.nfds; n++) { in sock_server()
188 if (srvst.fds[n].revents) { in sock_server()
190 if (!srvst.socks[n].cb(&srvst, n)) in sock_server()
202 for (n = 0; n < srvst.nfds; n++) { in sock_server()
204 if (srvst.fds[n].fd != -1 && srvst.socks[n].serv && in sock_server()
205 srvst.fds[n].fd != srvst.socks[n].serv->fd) { in sock_server()
206 if (close(srvst.fds[n].fd)) in sock_server()
207 warn("sock_server: close(%d)", srvst.fds[n].fd); in sock_server()
284 size_t n = 0; in sock_server_uninit() local
302 for (n = 0; n < ts->num_binds; n++) in sock_server_uninit()
303 if (close(ts->bind[n].fd)) in sock_server_uninit()
304 warn("sock_server_uninit: close(%d)", ts->bind[n].fd); in sock_server_uninit()