diff options
author | jhb <jhb@FreeBSD.org> | 2015-09-09 21:18:10 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2015-09-09 21:18:10 +0000 |
commit | fb3987c21531cd29da092923fde5db7cb89e1a36 (patch) | |
tree | 198f9b84d46515293c70185c0e80a7c04f235356 /tests | |
parent | 9f66ca5a18044d8a9d62557455d63fcf6e9a88f8 (diff) | |
download | FreeBSD-src-fb3987c21531cd29da092923fde5db7cb89e1a36.zip FreeBSD-src-fb3987c21531cd29da092923fde5db7cb89e1a36.tar.gz |
Properly size the children[] arrays in the follow fork tests.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/sys/kern/ptrace_test.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/sys/kern/ptrace_test.c b/tests/sys/kern/ptrace_test.c index c10c097..5388374 100644 --- a/tests/sys/kern/ptrace_test.c +++ b/tests/sys/kern/ptrace_test.c @@ -493,7 +493,7 @@ handle_fork_events(pid_t parent) ATF_TC_WITHOUT_HEAD(ptrace__follow_fork_both_attached); ATF_TC_BODY(ptrace__follow_fork_both_attached, tc) { - pid_t children[0], fpid, wpid; + pid_t children[2], fpid, wpid; int status; ATF_REQUIRE((fpid = fork()) != -1); @@ -549,7 +549,7 @@ ATF_TC_BODY(ptrace__follow_fork_both_attached, tc) ATF_TC_WITHOUT_HEAD(ptrace__follow_fork_child_detached); ATF_TC_BODY(ptrace__follow_fork_child_detached, tc) { - pid_t children[0], fpid, wpid; + pid_t children[2], fpid, wpid; int status; ATF_REQUIRE((fpid = fork()) != -1); @@ -600,7 +600,7 @@ ATF_TC_BODY(ptrace__follow_fork_child_detached, tc) ATF_TC_WITHOUT_HEAD(ptrace__follow_fork_parent_detached); ATF_TC_BODY(ptrace__follow_fork_parent_detached, tc) { - pid_t children[0], fpid, wpid; + pid_t children[2], fpid, wpid; int status; ATF_REQUIRE((fpid = fork()) != -1); @@ -681,7 +681,7 @@ attach_fork_parent(int cpipe[2]) ATF_TC_WITHOUT_HEAD(ptrace__follow_fork_both_attached_unrelated_debugger); ATF_TC_BODY(ptrace__follow_fork_both_attached_unrelated_debugger, tc) { - pid_t children[0], fpid, wpid; + pid_t children[2], fpid, wpid; int cpipe[2], status; ATF_REQUIRE(pipe(cpipe) == 0); @@ -749,7 +749,7 @@ ATF_TC_BODY(ptrace__follow_fork_both_attached_unrelated_debugger, tc) ATF_TC_WITHOUT_HEAD(ptrace__follow_fork_child_detached_unrelated_debugger); ATF_TC_BODY(ptrace__follow_fork_child_detached_unrelated_debugger, tc) { - pid_t children[0], fpid, wpid; + pid_t children[2], fpid, wpid; int cpipe[2], status; ATF_REQUIRE(pipe(cpipe) == 0); @@ -812,7 +812,7 @@ ATF_TC_BODY(ptrace__follow_fork_child_detached_unrelated_debugger, tc) ATF_TC_WITHOUT_HEAD(ptrace__follow_fork_parent_detached_unrelated_debugger); ATF_TC_BODY(ptrace__follow_fork_parent_detached_unrelated_debugger, tc) { - pid_t children[0], fpid, wpid; + pid_t children[2], fpid, wpid; int cpipe[2], status; ATF_REQUIRE(pipe(cpipe) == 0); |