The PIDFD_GET_INFO PPID check compares info.ppid against getppid(), but
its failure message prints pid and info.pid from the preceding PID
check.
Print the PPID values being compared so that a failure reports the
correct information.
Fixes: cdda1f26e74b ("pidfd: add ioctl to retrieve pid info")
Signed-off-by: Paul Dolan <[email protected]>
---
tools/testing/selftests/pidfd/pidfd_open_test.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/pidfd/pidfd_open_test.c
b/tools/testing/selftests/pidfd/pidfd_open_test.c
index 318e6f09c8e0..c6698b7cdb47 100644
--- a/tools/testing/selftests/pidfd/pidfd_open_test.c
+++ b/tools/testing/selftests/pidfd/pidfd_open_test.c
@@ -168,7 +168,7 @@ int main(int argc, char **argv)
}
if (info.ppid != getppid()) {
ksft_print_msg("ppid %d does not match ppid from ioctl %d\n",
- pid, info.pid);
+ getppid(), info.ppid);
goto on_error;
}
if (info.ruid != getuid()) {
--
2.55.0