Lines Matching refs:se_fd
443 if ((int)ev->ident != sep->se_fd)
448 ctrl = accept(sep->se_fd, NULL, NULL);
459 ctrl = sep->se_fd;
494 EV_SET(ev, sep->se_fd, EVFILT_READ,
572 if (s->se_fd != -1 && s->se_fd != ctrl) {
573 close(s->se_fd);
574 s->se_fd = -1;
661 EV_SET(ev, sep->se_fd, EVFILT_READ,
664 sep->se_service, sep->se_fd);
676 if (sep->se_fd == -1 && !ISMUX(sep)) {
684 if (sep->se_fd >= 0 && isrpcservice(sep))
698 if (sep->se_fd == -1)
713 (void)close(sep->se_fd);
714 sep->se_fd = -1;
731 if ((sep->se_fd = socket(sep->se_family, sep->se_socktype, 0)) < 0) {
739 if (fcntl(sep->se_fd, F_SETFD, FD_CLOEXEC) < 0) {
742 close(sep->se_fd);
743 sep->se_fd = -1;
750 turnon(sep->se_fd, SO_DEBUG) < 0)
752 if (turnon(sep->se_fd, SO_REUSEADDR) < 0)
757 if (sep->se_sndbuf != 0 && setsockopt(sep->se_fd, SOL_SOCKET,
761 if (sep->se_rcvbuf != 0 && setsockopt(sep->se_fd, SOL_SOCKET,
769 if (setsockopt(sep->se_fd, IPPROTO_IPV6, IPV6_FAITH,
777 int e = ipsecsetup(sep->se_family, sep->se_fd, sep->se_policy);
781 (void)close(sep->se_fd);
782 sep->se_fd = -1;
788 if (bind(sep->se_fd, &sep->se_ctrladdr, sep->se_ctrladdr_size) < 0) {
793 (void) close(sep->se_fd);
794 sep->se_fd = -1;
802 listen(sep->se_fd, 10);
808 if (setsockopt(sep->se_fd, IPPROTO_IP,
815 if (setsockopt(sep->se_fd, IPPROTO_IPV6,
825 if (sep->se_accf.af_name[0] != 0 && setsockopt(sep->se_fd, SOL_SOCKET,
832 EV_SET(ev, sep->se_fd, EVFILT_READ, EV_ADD | EV_ENABLE, 0, 0,
834 if (sep->se_fd > maxsock) {
835 maxsock = sep->se_fd;
839 DPRINTF(SERV_FMT ": registered on fd %d", SERV_PARAMS(sep), sep->se_fd);
849 if (sep->se_fd >= 0) {
850 (void) close(sep->se_fd);
851 sep->se_fd = -1;
875 if (getsockname(sep->se_fd, (struct sockaddr *)(void *)&ss, &socklen) < 0) {