mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
test: add fallback for SIGALRM
This commit is contained in:
parent
c94b382577
commit
7b14bc16f2
@ -1044,12 +1044,22 @@ signal_cb(evutil_socket_t fd, short event, void *arg)
|
||||
test_ok = 1;
|
||||
}
|
||||
|
||||
static void
|
||||
signal_alarm_fallback(int sig)
|
||||
{
|
||||
TT_DIE(("ALRM received not from event loop!"));
|
||||
end:
|
||||
;
|
||||
}
|
||||
|
||||
static void
|
||||
test_simple_signal_impl(int find_reorder)
|
||||
{
|
||||
struct event ev;
|
||||
struct itimerval itv;
|
||||
|
||||
signal(SIGALRM, signal_alarm_fallback);
|
||||
|
||||
evsignal_set(&ev, SIGALRM, signal_cb, &ev);
|
||||
evsignal_add(&ev, NULL);
|
||||
/* find bugs in which operations are re-ordered */
|
||||
@ -1124,6 +1134,8 @@ test_multiplesignal(void)
|
||||
|
||||
setup_test("Multiple signal: ");
|
||||
|
||||
signal(SIGALRM, signal_alarm_fallback);
|
||||
|
||||
evsignal_set(&ev_one, SIGALRM, signal_cb, &ev_one);
|
||||
evsignal_add(&ev_one, NULL);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user