Remove the now-useless evsig_caught and evsig_process

This commit is contained in:
Nick Mathewson 2010-09-15 01:54:51 -04:00
parent 95a7d418ab
commit 4858b7949c
10 changed files with 7 additions and 28 deletions

View File

@ -191,10 +191,7 @@ devpoll_dispatch(struct event_base *base, struct timeval *tv)
return (-1);
}
evsig_process(base);
return (0);
} else if (base->sig.evsig_caught) {
evsig_process(base);
}
event_debug(("%s: devpoll_wait reports %d", __func__, res));

View File

@ -321,10 +321,7 @@ epoll_dispatch(struct event_base *base, struct timeval *tv)
return (-1);
}
evsig_process(base);
return (0);
} else if (base->sig.evsig_caught) {
evsig_process(base);
}
event_debug(("%s: epoll_wait reports %d", __func__, res));

View File

@ -310,7 +310,6 @@ evport_dispatch(struct event_base *base, struct timeval *tv)
if (res == -1) {
if (errno == EINTR || errno == EAGAIN) {
evsig_process(base);
return (0);
} else if (errno == ETIME) {
if (nevents == 0)
@ -319,8 +318,6 @@ evport_dispatch(struct event_base *base, struct timeval *tv)
event_warn("port_getn");
return (-1);
}
} else if (base->sig.evsig_caught) {
evsig_process(base);
}
event_debug(("%s: port_getn reports %d events", __func__, nevents));

View File

@ -46,8 +46,6 @@ struct evsig_info {
/* Count of the number of signals we're currently watching. */
int ev_n_signals_added;
volatile sig_atomic_t evsig_caught;
/* Array of previous signal handler objects before Libevent started
* messing with them. Used to restore old signal handlers. */
#ifdef _EVENT_HAVE_SIGACTION
@ -59,7 +57,6 @@ struct evsig_info {
int sh_old_max;
};
int evsig_init(struct event_base *);
void evsig_process(struct event_base *);
void evsig_dealloc(struct event_base *);
void evsig_set_base(struct event_base *base);

View File

@ -379,6 +379,8 @@ kq_sig_add(struct event_base *base, int nsignal, short old, short events, void *
if (kevent(kqop->kq, &kev, 1, NULL, 0, &timeout) == -1)
return (-1);
/* XXXX The manpage suggest we could use SIG_IGN instead of a
* do-nothing handler */
if (_evsig_set_handler(base, nsignal, kq_sighandler) == -1)
return (-1);

3
poll.c
View File

@ -172,10 +172,7 @@ poll_dispatch(struct event_base *base, struct timeval *tv)
return (-1);
}
evsig_process(base);
return (0);
} else if (base->sig.evsig_caught) {
evsig_process(base);
}
event_debug(("%s: poll reports %d", __func__, res));

View File

@ -159,10 +159,7 @@ select_dispatch(struct event_base *base, struct timeval *tv)
return (-1);
}
evsig_process(base);
return (0);
} else if (base->sig.evsig_caught) {
evsig_process(base);
}
event_debug(("%s: select reports %d", __func__, res));

View File

@ -194,7 +194,6 @@ evsig_init(struct event_base *base)
evutil_make_socket_closeonexec(base->sig.ev_signal_pair[1]);
base->sig.sh_old = NULL;
base->sig.sh_old_max = 0;
base->sig.evsig_caught = 0;
evutil_make_socket_nonblocking(base->sig.ev_signal_pair[0]);
evutil_make_socket_nonblocking(base->sig.ev_signal_pair[1]);
@ -399,11 +398,6 @@ evsig_handler(int sig)
#endif
}
void
evsig_process(struct event_base *base)
{
}
void
evsig_dealloc(struct event_base *base)
{

View File

@ -1068,11 +1068,16 @@ test_signal_assert(void)
evsignal_del(&ev);
raise(SIGCONT);
#if 0
/* only way to verify we were in evsig_handler() */
/* XXXX Now there's no longer a good way. */
if (base->sig.evsig_caught)
test_ok = 0;
else
test_ok = 1;
#else
test_ok = 1;
#endif
event_base_free(base);
cleanup_test();

View File

@ -304,7 +304,6 @@ win32_dispatch(struct event_base *base, struct timeval *tv)
msec = LONG_MAX;
/* Windows doesn't like you to call select() with no sockets */
Sleep(msec);
evsig_process(base);
return (0);
}
@ -320,10 +319,7 @@ win32_dispatch(struct event_base *base, struct timeval *tv)
event_debug(("%s: select returned %d", __func__, res));
if (res <= 0) {
evsig_process(base);
return res;
} else if (base->sig.evsig_caught) {
evsig_process(base);
}
if (win32op->readset_out->fd_count) {