Date: Mon, 26 Aug 2019 08:07:10 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r351504 - stable/12/tests/sys/kern Message-ID: <201908260807.x7Q87AUW083643@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Mon Aug 26 08:07:10 2019 New Revision: 351504 URL: https://svnweb.freebsd.org/changeset/base/351504 Log: MFC r351211: sys.kern.pdeathsig.signal_delivered_ptrace: fix startup. PR: 237657 Modified: stable/12/tests/sys/kern/pdeathsig.c Directory Properties: stable/12/ (props changed) Modified: stable/12/tests/sys/kern/pdeathsig.c ============================================================================== --- stable/12/tests/sys/kern/pdeathsig.c Mon Aug 26 08:06:18 2019 (r351503) +++ stable/12/tests/sys/kern/pdeathsig.c Mon Aug 26 08:07:10 2019 (r351504) @@ -229,6 +229,7 @@ ATF_TC_BODY(signal_delivered_ptrace, tc) int rc; int pipe_ca[2]; int pipe_db[2]; + int pipe_cd[2]; char buffer; int status; @@ -236,6 +237,8 @@ ATF_TC_BODY(signal_delivered_ptrace, tc) ATF_REQUIRE(rc == 0); rc = pipe(pipe_db); ATF_REQUIRE(rc == 0); + rc = pipe(pipe_cd); + assert(rc == 0); rc = fork(); ATF_REQUIRE(rc != -1); @@ -263,6 +266,9 @@ ATF_TC_BODY(signal_delivered_ptrace, tc) rc = procctl(P_PID, 0, PROC_PDEATHSIG_CTL, &signum); assert(rc == 0); + rc = write(pipe_cd[1], "x", 1); + assert(rc == 1); + /* wait for B to die and signal us... */ signum = 0xdeadbeef; rc = sigwait(&sigset, &signum); @@ -292,6 +298,9 @@ ATF_TC_BODY(signal_delivered_ptrace, tc) rc = ptrace(PT_CONTINUE, c_pid, (caddr_t) 1, 0); assert(rc == 0); + + rc = read(pipe_cd[0], &buffer, 1); + assert(rc == 1); /* tell B that we're ready for it to exit now */ rc = write(pipe_db[1], ".", 1);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201908260807.x7Q87AUW083643>