Remove redundant pipe from pdeathsig.c test.

A pipe was was left over from a development version of pdeathsig.c and
is not needed.

Process C waits for a signal that'll be generated when process B
exists. Process B waits for process D to send it a byte via pipe_db
before it exits. Process D sends the byte after it has started
ptrace()ing process C. The point of the test is to show that process C
receives the signal because process B exited, even though C has been
reparented to process D. The pipe pipe_cd isn't doing anything useful
(though in an earlier version of the patch it did). Clean that up by
removing the useless pipe.

Submitted by:	Thomas Munro
MFC after:	6 days
Differential revision:	https://reviews.freebsd.org/D15214
This commit is contained in:
Konstantin Belousov 2018-04-27 16:34:28 +00:00
parent d552176e4b
commit 1187fc2dc6

View File

@ -229,7 +229,6 @@ 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;
@ -237,8 +236,6 @@ ATF_TC_BODY(signal_delivered_ptrace, tc)
ATF_REQUIRE(rc == 0);
rc = pipe(pipe_db);
ATF_REQUIRE(rc == 0);
rc = pipe(pipe_cd);
ATF_REQUIRE(rc == 0);
rc = fork();
ATF_REQUIRE(rc != -1);
@ -266,10 +263,6 @@ ATF_TC_BODY(signal_delivered_ptrace, tc)
rc = procctl(P_PID, 0, PROC_PDEATHSIG_CTL, &signum);
assert(rc == 0);
/* tell D we are ready for it to attach */
rc = write(pipe_cd[1], ".", 1);
assert(rc == 1);
/* wait for B to die and signal us... */
signum = 0xdeadbeef;
rc = sigwait(&sigset, &signum);