]> granicus.if.org Git - libevent/commitdiff
test/regress: cover signals after fork() + event_reinit()
authorAzat Khuzhin <a3at.mail@gmail.com>
Sun, 27 Dec 2015 06:26:54 +0000 (09:26 +0300)
committerAzat Khuzhin <a3at.mail@gmail.com>
Sun, 27 Dec 2015 06:29:57 +0000 (09:29 +0300)
Regression-for: ad0c237 ("event_reinit: always re-init signal's socketpair")

test/regress.c

index d200ae3571e2ba23d4bf42dfa8faf2ec4215faea..7d785904776d077490b9c3f2500c89ee85b42e37 100644 (file)
@@ -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);