Fix ptrace_test:ptrace__syscall_args after ATF upgrade

ATF now opens the results file (without CLOEXEC), so the child actually
has a valid file descriptor 3. To fix this simply use a large number that
will definitely not be a valid file descriptor.

Reviewed by:	jhb, cem, lwhsu
Differential Revision: https://reviews.freebsd.org/D28889
This commit is contained in:
Alex Richardson 2021-02-23 12:51:35 +00:00
parent 1032131464
commit 17cc20092c

View File

@ -3947,7 +3947,8 @@ ATF_TC_BODY(ptrace__syscall_args, tc)
if (fpid == 0) {
trace_me();
kill(getpid(), 0);
close(3);
/* Close a fd that should not exist. */
close(12345);
exit(1);
}
@ -4049,7 +4050,7 @@ ATF_TC_BODY(ptrace__syscall_args, tc)
ATF_REQUIRE(ptrace(PT_GET_SC_ARGS, wpid, (caddr_t)args,
sizeof(args)) != -1);
REQUIRE_EQ(args[0], 3);
REQUIRE_EQ(args[0], 12345);
REQUIRE_EQ(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0), 0);