yp.c (b626f5a73a48f44a31a200291b141e1da408a2ff) yp.c (3bf7d9a6ebe7f0bd629f421399048bbf49b54e3a)
1/* $OpenBSD: yp.c,v 1.14 2015/02/11 01:26:00 pelikan Exp $ */
2/* $FreeBSD$ */
3/*
4 * Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
5 *
6 * Permission to use, copy, modify, and distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.

--- 69 unchanged lines hidden (view full) ---

78 free(ye);
79 }
80}
81
82void
83yp_enable_events(void)
84{
85 int i;
1/* $OpenBSD: yp.c,v 1.14 2015/02/11 01:26:00 pelikan Exp $ */
2/* $FreeBSD$ */
3/*
4 * Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
5 *
6 * Permission to use, copy, modify, and distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.

--- 69 unchanged lines hidden (view full) ---

78 free(ye);
79 }
80}
81
82void
83yp_enable_events(void)
84{
85 int i;
86 extern fd_set svc_fdset;
86 extern fd_set svc_fdset;
87 struct yp_event *ye;
88
87 struct yp_event *ye;
88
89 for (i = 0; i < getdtablesize(); i++) {
89 for (i = 0; i < FD_SETSIZE; i++) {
90 if (FD_ISSET(i, &svc_fdset)) {
91 if ((ye = calloc(1, sizeof(*ye))) == NULL)
92 fatal(NULL);
93 event_set(&ye->ye_event, i, EV_READ, yp_fd_event, NULL);
94 event_add(&ye->ye_event, NULL);
95 TAILQ_INSERT_TAIL(&env->sc_yp->yd_events, ye, ye_entry);
96 }
97 }

--- 555 unchanged lines hidden ---
90 if (FD_ISSET(i, &svc_fdset)) {
91 if ((ye = calloc(1, sizeof(*ye))) == NULL)
92 fatal(NULL);
93 event_set(&ye->ye_event, i, EV_READ, yp_fd_event, NULL);
94 event_add(&ye->ye_event, NULL);
95 TAILQ_INSERT_TAIL(&env->sc_yp->yd_events, ye, ye_entry);
96 }
97 }

--- 555 unchanged lines hidden ---