mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-08 11:53:00 -04:00
test/regress: cover existing signal callbacks and fork() + event_reinit()
Regression-for: 88640aa ("event_reinit: make signals works after fork() without evsig_add()")
This commit is contained in:
parent
b075b81cd3
commit
ceddc607ca
@ -832,7 +832,7 @@ static void
|
||||
test_fork(void)
|
||||
{
|
||||
int status;
|
||||
struct event ev, sig_ev, usr_ev;
|
||||
struct event ev, sig_ev, usr_ev, existing_ev;
|
||||
pid_t pid;
|
||||
|
||||
setup_test("After fork: ");
|
||||
@ -851,6 +851,9 @@ test_fork(void)
|
||||
evsignal_set(&sig_ev, SIGCHLD, fork_signal_cb, &sig_ev);
|
||||
evsignal_add(&sig_ev, NULL);
|
||||
|
||||
evsignal_set(&existing_ev, SIGUSR2, fork_signal_cb, &existing_ev);
|
||||
evsignal_add(&existing_ev, NULL);
|
||||
|
||||
event_base_assert_ok_(current_base);
|
||||
TT_BLATHER(("Before fork"));
|
||||
if ((pid = regress_fork()) == 0) {
|
||||
@ -870,6 +873,7 @@ test_fork(void)
|
||||
evsignal_set(&usr_ev, SIGUSR1, fork_signal_cb, &usr_ev);
|
||||
evsignal_add(&usr_ev, NULL);
|
||||
raise(SIGUSR1);
|
||||
raise(SIGUSR2);
|
||||
|
||||
called = 0;
|
||||
|
||||
@ -915,6 +919,7 @@ test_fork(void)
|
||||
evsignal_set(&usr_ev, SIGUSR1, fork_signal_cb, &usr_ev);
|
||||
evsignal_add(&usr_ev, NULL);
|
||||
raise(SIGUSR1);
|
||||
raise(SIGUSR2);
|
||||
|
||||
event_dispatch();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user