diff options
author | Michael Ellerman <mpe@ellerman.id.au> | 2022-06-27 17:02:37 +0300 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2022-07-25 05:05:16 +0300 |
commit | 7b1513d02edf4a6334618070641f47abbbef0cef (patch) | |
tree | 6cc15b316491fb31c8f6629e96bac7ed854bda43 /tools | |
parent | 611e385087efc2cc3a7033aedd3f84ad0cf2a703 (diff) | |
download | linux-7b1513d02edf4a6334618070641f47abbbef0cef.tar.xz |
selftests/powerpc/ptrace: Make child errors more obvious
Use the FAIL_IF() macro so that errors in the child report a line
number, rather than just silently exiting.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220627140239.2464900-11-mpe@ellerman.id.au
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/selftests/powerpc/ptrace/ptrace-gpr.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/tools/testing/selftests/powerpc/ptrace/ptrace-gpr.c b/tools/testing/selftests/powerpc/ptrace/ptrace-gpr.c index 4e7a7eb01e3a..b574ea26395c 100644 --- a/tools/testing/selftests/powerpc/ptrace/ptrace-gpr.c +++ b/tools/testing/selftests/powerpc/ptrace/ptrace-gpr.c @@ -19,7 +19,7 @@ double c = FPR_3; extern void gpr_child_loop(int *read_flag, int *write_flag, unsigned long *gpr_buf, double *fpr_buf); -void gpr(void) +static int child(void) { unsigned long gpr_buf[32]; double fpr_buf[32]; @@ -38,13 +38,10 @@ void gpr(void) shmdt((void *)cptr); - if (validate_gpr(gpr_buf, GPR_3)) - exit(1); + FAIL_IF(validate_gpr(gpr_buf, GPR_3)); + FAIL_IF(validate_fpr_double(fpr_buf, c)); - if (validate_fpr_double(fpr_buf, c)) - exit(1); - - exit(0); + return 0; } int trace_gpr(pid_t child) @@ -76,7 +73,7 @@ int ptrace_gpr(void) return TEST_FAIL; } if (pid == 0) - gpr(); + exit(child()); if (pid) { pptr = (int *)shmat(shm_id, NULL, 0); |