• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/iserver/libevent-1.4.14b-stable/

Lines Matching refs:sig

68 static void evsignal_handler(int sig);
106 AF_UNIX, SOCK_STREAM, 0, base->sig.ev_signal_pair) == -1) {
117 FD_CLOSEONEXEC(base->sig.ev_signal_pair[0]);
118 FD_CLOSEONEXEC(base->sig.ev_signal_pair[1]);
119 base->sig.sh_old = NULL;
120 base->sig.sh_old_max = 0;
121 base->sig.evsignal_caught = 0;
122 memset(&base->sig.evsigcaught, 0, sizeof(sig_atomic_t)*NSIG);
125 TAILQ_INIT(&base->sig.evsigevents[i]);
127 evutil_make_socket_nonblocking(base->sig.ev_signal_pair[0]);
129 event_set(&base->sig.ev_signal, base->sig.ev_signal_pair[1],
130 EV_READ | EV_PERSIST, evsignal_cb, &base->sig.ev_signal);
131 base->sig.ev_signal.ev_base = base;
132 base->sig.ev_signal.ev_flags |= EVLIST_INTERNAL;
148 struct evsignal_info *sig = &base->sig;
155 if (evsignal >= sig->sh_old_max) {
158 __func__, evsignal, sig->sh_old_max));
159 p = realloc(sig->sh_old, new_max * sizeof(*sig->sh_old));
165 memset((char *)p + sig->sh_old_max * sizeof(*sig->sh_old),
166 0, (new_max - sig->sh_old_max) * sizeof(*sig->sh_old));
168 sig->sh_old_max = new_max;
169 sig->sh_old = p;
173 sig->sh_old[evsignal] = malloc(sizeof *sig->sh_old[evsignal]);
174 if (sig->sh_old[evsignal] == NULL) {
186 if (sigaction(evsignal, &sa, sig->sh_old[evsignal]) == -1) {
188 free(sig->sh_old[evsignal]);
189 sig->sh_old[evsignal] = NULL;
195 free(sig->sh_old[evsignal]);
196 sig->sh_old[evsignal] = NULL;
199 *sig->sh_old[evsignal] = sh;
210 struct evsignal_info *sig = &ev->ev_base->sig;
216 if (TAILQ_EMPTY(&sig->evsigevents[evsignal])) {
225 if (!sig->ev_signal_added) {
226 if (event_add(&sig->ev_signal, NULL))
228 sig->ev_signal_added = 1;
233 TAILQ_INSERT_TAIL(&sig->evsigevents[evsignal], ev, ev_signal_next);
242 struct evsignal_info *sig = &base->sig;
250 sh = sig->sh_old[evsignal];
251 sig->sh_old[evsignal] = NULL;
272 struct evsignal_info *sig = &base->sig;
278 TAILQ_REMOVE(&sig->evsigevents[evsignal], ev, ev_signal_next);
280 if (!TAILQ_EMPTY(&sig->evsigevents[evsignal]))
289 evsignal_handler(int sig)
296 __func__, sig);
300 evsignal_base->sig.evsigcaught[sig]++;
301 evsignal_base->sig.evsignal_caught = 1;
304 signal(sig, evsignal_handler);
308 send(evsignal_base->sig.ev_signal_pair[0], "a", 1, 0);
315 struct evsignal_info *sig = &base->sig;
320 base->sig.evsignal_caught = 0;
322 ncalls = sig->evsigcaught[i];
325 sig->evsigcaught[i] -= ncalls;
327 for (ev = TAILQ_FIRST(&sig->evsigevents[i]);
342 if (base->sig.ev_signal_added) {
343 event_del(&base->sig.ev_signal);
344 base->sig.ev_signal_added = 0;
347 if (i < base->sig.sh_old_max && base->sig.sh_old[i] != NULL)
351 if (base->sig.ev_signal_pair[0] != -1) {
352 EVUTIL_CLOSESOCKET(base->sig.ev_signal_pair[0]);
353 base->sig.ev_signal_pair[0] = -1;
355 if (base->sig.ev_signal_pair[1] != -1) {
356 EVUTIL_CLOSESOCKET(base->sig.ev_signal_pair[1]);
357 base->sig.ev_signal_pair[1] = -1;
359 base->sig.sh_old_max = 0;
362 if (base->sig.sh_old) {
363 free(base->sig.sh_old);
364 base->sig.sh_old = NULL;