From: Azat Khuzhin Date: Sun, 27 Dec 2015 06:26:54 +0000 (+0300) Subject: test/regress: cover signals after fork() + event_reinit() X-Git-Tag: release-2.1.6-beta~87^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b075b81cd347aaf3c170940819d6857e0f67e75e;p=libevent test/regress: cover signals after fork() + event_reinit() Regression-for: ad0c237 ("event_reinit: always re-init signal's socketpair") --- diff --git a/test/regress.c b/test/regress.c index d200ae35..7d785904 100644 --- a/test/regress.c +++ b/test/regress.c @@ -832,7 +832,7 @@ static void test_fork(void) { int status; - struct event ev, sig_ev; + struct event ev, sig_ev, usr_ev; pid_t pid; setup_test("After fork: "); @@ -867,6 +867,10 @@ test_fork(void) evsignal_del(&sig_ev); + evsignal_set(&usr_ev, SIGUSR1, fork_signal_cb, &usr_ev); + evsignal_add(&usr_ev, NULL); + raise(SIGUSR1); + called = 0; event_dispatch(); @@ -908,6 +912,10 @@ test_fork(void) shutdown(pair[0], SHUT_WR); + evsignal_set(&usr_ev, SIGUSR1, fork_signal_cb, &usr_ev); + evsignal_add(&usr_ev, NULL); + raise(SIGUSR1); + event_dispatch(); evsignal_del(&sig_ev);