From 2d5a34b4f3a3bb6112bc940fa4e3189037770c1d Mon Sep 17 00:00:00 2001
From: anton <>
Date: Tue, 28 Sep 2021 05:39:24 +0000
Subject: 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.

---
 src/regress/lib/libc/sys/t_fork.c | 16 +---------------
 src/regress/lib/libc/sys/t_kill.c | 16 +---------------
 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 @@
-/*	$OpenBSD: t_fork.c,v 1.3 2021/09/09 17:36:34 anton Exp $	*/
+/*	$OpenBSD: t_fork.c,v 1.4 2021/09/28 05:39:24 anton Exp $	*/
 /*	$NetBSD: t_fork.c,v 1.4 2019/04/06 15:41:54 kamil Exp $	*/
 
 /*-
@@ -142,21 +142,10 @@ await_stopped_child(pid_t process)
 static void
 raise_raw(int sig)
 {
-	struct sigaction act, oact;
 	int rv, status;
 	pid_t child, parent, watcher, wpid;
 	int expect_core = (sig == SIGABRT) ? 1 : 0;
 
-	/* Ensure the signal is not ignored. */
-	if (sig != SIGKILL && sig != SIGSTOP) {
-		memset(&act, 0, sizeof(act));
-		act.sa_handler = SIG_DFL;
-		ATF_REQUIRE(sigaction(sig, &act, &oact) == 0);
-	} else {
-		ATF_REQUIRE(sigaction(sig, &act, &oact) != 0);
-		ATF_REQUIRE(errno == EINVAL);
-	}
-
 	/*
 	 * Spawn a dedicated thread to watch for a stopped child and emit
 	 * the SIGKILL signal to it.
@@ -214,9 +203,6 @@ raise_raw(int sig)
 	}
 	wpid = waitpid(child, &status, 0);
 
-	if (sig != SIGKILL && sig != SIGSTOP)
-		ATF_REQUIRE(sigaction(sig, &oact, NULL) == 0);
-
 	ATF_REQUIRE_EQ(wpid, child);
 
 	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 @@
-/*	$OpenBSD: t_kill.c,v 1.2 2021/07/29 15:33:17 anton Exp $	*/
+/*	$OpenBSD: t_kill.c,v 1.3 2021/09/28 05:39:24 anton Exp $	*/
 /* $NetBSD: t_kill.c,v 1.1 2011/07/07 06:57:53 jruoho Exp $ */
 
 /*-
@@ -60,17 +60,6 @@ ATF_TC_BODY(kill_basic, tc)
 	int sta;
 
 	for (i = 0; i < __arraycount(sig); i++) {
-		struct sigaction act, oact;
-
-		/* Ensure the signal is not ignored. */
-		if (sig[i] != SIGKILL) {
-			memset(&act, 0, sizeof(act));
-			act.sa_handler = SIG_DFL;
-			ATF_REQUIRE(sigaction(sig[i], &act, &oact) == 0);
-		} else {
-			ATF_REQUIRE(sigaction(sig[i], &act, &oact) != 0);
-			ATF_REQUIRE(errno == EINVAL);
-		}
 
 		pid = fork();
 		ATF_REQUIRE(pid >= 0);
@@ -89,9 +78,6 @@ ATF_TC_BODY(kill_basic, tc)
 
 		if (WIFSIGNALED(sta) == 0 || WTERMSIG(sta) != sig[i])
 			atf_tc_fail("kill(2) failed to kill child");
-
-		if (sig[i] != SIGKILL)
-			ATF_REQUIRE(sigaction(sig[i], &oact, NULL) == 0);
 	}
 }
 
-- 
cgit v1.2.3-55-g6feb