Module Name:    src
Committed By:   kamil
Date:           Wed Apr  3 08:19:46 UTC 2019

Modified Files:
        src/tests/lib/libc/sys: t_ptrace_wait.c

Log Message:
The *fork*_signalmasked ATF tests no longer fail

Add a fixup for signalmasking in the vforkdone_singalmasked test.


To generate a diff of this commit:
cvs rdiff -u -r1.101 -r1.102 src/tests/lib/libc/sys/t_ptrace_wait.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libc/sys/t_ptrace_wait.c
diff -u src/tests/lib/libc/sys/t_ptrace_wait.c:1.101 src/tests/lib/libc/sys/t_ptrace_wait.c:1.102
--- src/tests/lib/libc/sys/t_ptrace_wait.c:1.101	Thu Mar 28 08:13:40 2019
+++ src/tests/lib/libc/sys/t_ptrace_wait.c	Wed Apr  3 08:19:46 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.101 2019/03/28 08:13:40 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.102 2019/04/03 08:19:46 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016, 2017, 2018, 2019 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.101 2019/03/28 08:13:40 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.102 2019/04/03 08:19:46 kamil Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -5221,9 +5221,6 @@ fork2_body(bool trackfork, bool trackvfo
 	ki_sigset_t kp_sigmask;
 	ki_sigset_t kp_sigignore;
 
-	if (masked)
-		atf_tc_expect_fail("Masked signal invisible to tracer");
-
 	if (trackfork)
 		fn = fork;
 	if (trackvfork || trackvforkdone)
@@ -5447,6 +5444,12 @@ fork2_body(bool trackfork, bool trackvfo
 		name[3] = child;
 		ATF_REQUIRE_EQ(sysctl(name, namelen, &kp, &len, NULL, 0), 0);
 
+		/*
+		 * SIGCHLD is now pending in the signal queue and
+		 * the kernel presents it to userland as a masked signal.
+		 */
+		sigdelset((sigset_t *)&kp.p_sigmask, SIGCHLD);
+
 		if (masked) {
 			DPRINTF("kp_sigmask="
 			    "%#02" PRIx32 "%02" PRIx32 "%02" PRIx32 "%02"

Reply via email to