summaryrefslogtreecommitdiff
path: root/src/regress/lib/libc/sys/t_fork.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/regress/lib/libc/sys/t_fork.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/src/regress/lib/libc/sys/t_fork.c b/src/regress/lib/libc/sys/t_fork.c
index b28ee9dc55..8fbc502d1f 100644
--- a/src/regress/lib/libc/sys/t_fork.c
+++ b/src/regress/lib/libc/sys/t_fork.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: t_fork.c,v 1.3 2021/09/09 17:36:34 anton Exp $ */ 1/* $OpenBSD: t_fork.c,v 1.4 2021/09/28 05:39:24 anton Exp $ */
2/* $NetBSD: t_fork.c,v 1.4 2019/04/06 15:41:54 kamil Exp $ */ 2/* $NetBSD: t_fork.c,v 1.4 2019/04/06 15:41:54 kamil Exp $ */
3 3
4/*- 4/*-
@@ -142,21 +142,10 @@ await_stopped_child(pid_t process)
142static void 142static void
143raise_raw(int sig) 143raise_raw(int sig)
144{ 144{
145 struct sigaction act, oact;
146 int rv, status; 145 int rv, status;
147 pid_t child, parent, watcher, wpid; 146 pid_t child, parent, watcher, wpid;
148 int expect_core = (sig == SIGABRT) ? 1 : 0; 147 int expect_core = (sig == SIGABRT) ? 1 : 0;
149 148
150 /* Ensure the signal is not ignored. */
151 if (sig != SIGKILL && sig != SIGSTOP) {
152 memset(&act, 0, sizeof(act));
153 act.sa_handler = SIG_DFL;
154 ATF_REQUIRE(sigaction(sig, &act, &oact) == 0);
155 } else {
156 ATF_REQUIRE(sigaction(sig, &act, &oact) != 0);
157 ATF_REQUIRE(errno == EINVAL);
158 }
159
160 /* 149 /*
161 * Spawn a dedicated thread to watch for a stopped child and emit 150 * Spawn a dedicated thread to watch for a stopped child and emit
162 * the SIGKILL signal to it. 151 * the SIGKILL signal to it.
@@ -214,9 +203,6 @@ raise_raw(int sig)
214 } 203 }
215 wpid = waitpid(child, &status, 0); 204 wpid = waitpid(child, &status, 0);
216 205
217 if (sig != SIGKILL && sig != SIGSTOP)
218 ATF_REQUIRE(sigaction(sig, &oact, NULL) == 0);
219
220 ATF_REQUIRE_EQ(wpid, child); 206 ATF_REQUIRE_EQ(wpid, child);
221 207
222 switch (sig) { 208 switch (sig) {