Skip to contentSkip to conversation

selftests/pidfd: fix PPID values in error message

PATCH Applied Paul Dolan 2 participants 2 messages Sep 2 – Sep 4

Subsystems (2)
lore
Share & tools
lore

Paul Dolan

author
#0 lore raw

PATCH 1/1 selftests/pidfd: fix PPID values in error message

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")
---
 tools/testing/selftests/pidfd/pidfd_open_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/pidfd/pidfd_open_test.c +1 -1
index 318e6f09c8e0..c6698b7cdb47 100644
@@ -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()) {
Signature · 1 line
2.55.0
#1 lore raw
Quoted 8 lines · Paul Dolan

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.

[...]

Applied to the vfs-7.4.misc branch of the vfs/vfs.git tree. Patches in the vfs-7.4.misc branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase, trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs-7.4.misc

[1/1] selftests/pidfd: fix PPID values in error message

      https://git.kernel.org/vfs/vfs/c/b4ad6eb49532