Lines Matching refs:sig
116 static void __cdecl evsig_handler(int sig);
126 evsig_base_n_signals_added = base->sig.ev_n_signals_added; in evsig_set_base_()
127 evsig_base_fd = base->sig.ev_signal_pair[1]; in evsig_set_base_()
161 ev_uint8_t sig = signals[i]; in evsig_cb() local
162 if (sig < NSIG) in evsig_cb()
163 ncaught[sig]++; in evsig_cb()
183 if (evutil_make_internal_pipe_(base->sig.ev_signal_pair) == -1) { in evsig_init_()
194 if (base->sig.sh_old) { in evsig_init_()
195 mm_free(base->sig.sh_old); in evsig_init_()
197 base->sig.sh_old = NULL; in evsig_init_()
198 base->sig.sh_old_max = 0; in evsig_init_()
200 event_assign(&base->sig.ev_signal, base, base->sig.ev_signal_pair[0], in evsig_init_()
203 base->sig.ev_signal.ev_flags |= EVLIST_INTERNAL; in evsig_init_()
204 event_priority_set(&base->sig.ev_signal, 0); in evsig_init_()
222 struct evsig_info *sig = &base->sig; in evsig_set_handler_() local
229 if (evsignal >= sig->sh_old_max) { in evsig_set_handler_()
232 __func__, evsignal, sig->sh_old_max)); in evsig_set_handler_()
233 p = mm_realloc(sig->sh_old, new_max * sizeof(*sig->sh_old)); in evsig_set_handler_()
239 memset((char *)p + sig->sh_old_max * sizeof(*sig->sh_old), in evsig_set_handler_()
240 0, (new_max - sig->sh_old_max) * sizeof(*sig->sh_old)); in evsig_set_handler_()
242 sig->sh_old_max = new_max; in evsig_set_handler_()
243 sig->sh_old = p; in evsig_set_handler_()
247 sig->sh_old[evsignal] = mm_malloc(sizeof *sig->sh_old[evsignal]); in evsig_set_handler_()
248 if (sig->sh_old[evsignal] == NULL) { in evsig_set_handler_()
260 if (sigaction(evsignal, &sa, sig->sh_old[evsignal]) == -1) { in evsig_set_handler_()
262 mm_free(sig->sh_old[evsignal]); in evsig_set_handler_()
263 sig->sh_old[evsignal] = NULL; in evsig_set_handler_()
269 mm_free(sig->sh_old[evsignal]); in evsig_set_handler_()
270 sig->sh_old[evsignal] = NULL; in evsig_set_handler_()
273 *sig->sh_old[evsignal] = sh; in evsig_set_handler_()
282 struct evsig_info *sig = &base->sig; in evsig_add() local
299 evsig_base_n_signals_added = ++sig->ev_n_signals_added; in evsig_add()
300 evsig_base_fd = base->sig.ev_signal_pair[1]; in evsig_add()
309 if (!sig->ev_signal_added) { in evsig_add()
310 if (event_add_nolock_(&sig->ev_signal, NULL, 0)) in evsig_add()
312 sig->ev_signal_added = 1; in evsig_add()
320 --sig->ev_n_signals_added; in evsig_add()
329 struct evsig_info *sig = &base->sig; in evsig_restore_handler_() local
336 if (evsignal >= sig->sh_old_max) { in evsig_restore_handler_()
343 sh = sig->sh_old[evsignal]; in evsig_restore_handler_()
344 sig->sh_old[evsignal] = NULL; in evsig_restore_handler_()
372 --base->sig.ev_n_signals_added; in evsig_del()
379 evsig_handler(int sig) in evsig_handler() argument
390 __func__, sig); in evsig_handler()
395 signal(sig, evsig_handler); in evsig_handler()
399 msg = sig; in evsig_handler()
418 if (base->sig.ev_signal_added) { in evsig_dealloc_()
419 event_del(&base->sig.ev_signal); in evsig_dealloc_()
420 base->sig.ev_signal_added = 0; in evsig_dealloc_()
424 event_debug_unassign(&base->sig.ev_signal); in evsig_dealloc_()
427 if (i < base->sig.sh_old_max && base->sig.sh_old[i] != NULL) in evsig_dealloc_()
438 if (base->sig.ev_signal_pair[0] != -1) { in evsig_dealloc_()
439 evutil_closesocket(base->sig.ev_signal_pair[0]); in evsig_dealloc_()
440 base->sig.ev_signal_pair[0] = -1; in evsig_dealloc_()
442 if (base->sig.ev_signal_pair[1] != -1) { in evsig_dealloc_()
443 evutil_closesocket(base->sig.ev_signal_pair[1]); in evsig_dealloc_()
444 base->sig.ev_signal_pair[1] = -1; in evsig_dealloc_()
446 base->sig.sh_old_max = 0; in evsig_dealloc_()
449 if (base->sig.sh_old) { in evsig_dealloc_()
450 mm_free(base->sig.sh_old); in evsig_dealloc_()
451 base->sig.sh_old = NULL; in evsig_dealloc_()