Lines Matching refs:base
96 evsignal_init(struct event_base *base) in evsignal_init() argument
106 AF_UNIX, SOCK_STREAM, 0, base->sig.ev_signal_pair) == -1) { in evsignal_init()
117 FD_CLOSEONEXEC(base->sig.ev_signal_pair[0]); in evsignal_init()
118 FD_CLOSEONEXEC(base->sig.ev_signal_pair[1]); in evsignal_init()
119 base->sig.sh_old = NULL; in evsignal_init()
120 base->sig.sh_old_max = 0; in evsignal_init()
121 base->sig.evsignal_caught = 0; in evsignal_init()
122 memset(&base->sig.evsigcaught, 0, sizeof(sig_atomic_t)*NSIG); in evsignal_init()
125 TAILQ_INIT(&base->sig.evsigevents[i]); in evsignal_init()
127 evutil_make_socket_nonblocking(base->sig.ev_signal_pair[0]); in evsignal_init()
129 event_set(&base->sig.ev_signal, base->sig.ev_signal_pair[1], in evsignal_init()
130 EV_READ | EV_PERSIST, evsignal_cb, &base->sig.ev_signal); in evsignal_init()
131 base->sig.ev_signal.ev_base = base; in evsignal_init()
132 base->sig.ev_signal.ev_flags |= EVLIST_INTERNAL; in evsignal_init()
140 _evsignal_set_handler(struct event_base *base, in _evsignal_set_handler() argument
148 struct evsignal_info *sig = &base->sig; in _evsignal_set_handler()
207 struct event_base *base = ev->ev_base; in evsignal_add() local
217 base, evsignal, evsignal_handler) == -1) in evsignal_add()
221 evsignal_base = base; in evsignal_add()
237 _evsignal_restore_handler(struct event_base *base, int evsignal) in _evsignal_restore_handler() argument
240 struct evsignal_info *sig = &base->sig; in _evsignal_restore_handler()
269 struct event_base *base = ev->ev_base; in evsignal_del() local
270 struct evsignal_info *sig = &base->sig; in evsignal_del()
311 evsignal_process(struct event_base *base) in evsignal_process() argument
313 struct evsignal_info *sig = &base->sig; in evsignal_process()
318 base->sig.evsignal_caught = 0; in evsignal_process()
337 evsignal_dealloc(struct event_base *base) in evsignal_dealloc() argument
340 if (base->sig.ev_signal_added) { in evsignal_dealloc()
341 event_del(&base->sig.ev_signal); in evsignal_dealloc()
342 base->sig.ev_signal_added = 0; in evsignal_dealloc()
345 if (i < base->sig.sh_old_max && base->sig.sh_old[i] != NULL) in evsignal_dealloc()
346 _evsignal_restore_handler(base, i); in evsignal_dealloc()
349 EVUTIL_CLOSESOCKET(base->sig.ev_signal_pair[0]); in evsignal_dealloc()
350 base->sig.ev_signal_pair[0] = -1; in evsignal_dealloc()
351 EVUTIL_CLOSESOCKET(base->sig.ev_signal_pair[1]); in evsignal_dealloc()
352 base->sig.ev_signal_pair[1] = -1; in evsignal_dealloc()
353 base->sig.sh_old_max = 0; in evsignal_dealloc()
356 free(base->sig.sh_old); in evsignal_dealloc()