summaryrefslogtreecommitdiff
path: root/src/regress/lib/libc/sys
diff options
context:
space:
mode:
authoranton <>2021-09-28 05:39:24 +0000
committeranton <>2021-09-28 05:39:24 +0000
commit2d5a34b4f3a3bb6112bc940fa4e3189037770c1d (patch)
tree27a93af339c4e7669216014537e8102644cd2029 /src/regress/lib/libc/sys
parentacb87ec6566df0983bb1e9789ba5181747b4e203 (diff)
downloadopenbsd-2d5a34b4f3a3bb6112bc940fa4e3189037770c1d.tar.gz
openbsd-2d5a34b4f3a3bb6112bc940fa4e3189037770c1d.tar.bz2
openbsd-2d5a34b4f3a3bb6112bc940fa4e3189037770c1d.zip
Remove recent changes used to unblock the signal undergoing testing, I solved it
by changing my regress environment instead. This reduces the delta to the NetBSD upstream.
Diffstat (limited to 'src/regress/lib/libc/sys')
-rw-r--r--src/regress/lib/libc/sys/t_fork.c16
-rw-r--r--src/regress/lib/libc/sys/t_kill.c16
2 files changed, 2 insertions, 30 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) {
diff --git a/src/regress/lib/libc/sys/t_kill.c b/src/regress/lib/libc/sys/t_kill.c
index 871427cb8d..bce0f2f111 100644
--- a/src/regress/lib/libc/sys/t_kill.c
+++ b/src/regress/lib/libc/sys/t_kill.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: t_kill.c,v 1.2 2021/07/29 15:33:17 anton Exp $ */ 1/* $OpenBSD: t_kill.c,v 1.3 2021/09/28 05:39:24 anton Exp $ */
2/* $NetBSD: t_kill.c,v 1.1 2011/07/07 06:57:53 jruoho Exp $ */ 2/* $NetBSD: t_kill.c,v 1.1 2011/07/07 06:57:53 jruoho Exp $ */
3 3
4/*- 4/*-
@@ -60,17 +60,6 @@ ATF_TC_BODY(kill_basic, tc)
60 int sta; 60 int sta;
61 61
62 for (i = 0; i < __arraycount(sig); i++) { 62 for (i = 0; i < __arraycount(sig); i++) {
63 struct sigaction act, oact;
64
65 /* Ensure the signal is not ignored. */
66 if (sig[i] != SIGKILL) {
67 memset(&act, 0, sizeof(act));
68 act.sa_handler = SIG_DFL;
69 ATF_REQUIRE(sigaction(sig[i], &act, &oact) == 0);
70 } else {
71 ATF_REQUIRE(sigaction(sig[i], &act, &oact) != 0);
72 ATF_REQUIRE(errno == EINVAL);
73 }
74 63
75 pid = fork(); 64 pid = fork();
76 ATF_REQUIRE(pid >= 0); 65 ATF_REQUIRE(pid >= 0);
@@ -89,9 +78,6 @@ ATF_TC_BODY(kill_basic, tc)
89 78
90 if (WIFSIGNALED(sta) == 0 || WTERMSIG(sta) != sig[i]) 79 if (WIFSIGNALED(sta) == 0 || WTERMSIG(sta) != sig[i])
91 atf_tc_fail("kill(2) failed to kill child"); 80 atf_tc_fail("kill(2) failed to kill child");
92
93 if (sig[i] != SIGKILL)
94 ATF_REQUIRE(sigaction(sig[i], &oact, NULL) == 0);
95 } 81 }
96} 82}
97 83