From: Mark Brown Date: Thu, 26 Feb 2026 16:05:25 +0000 (+0000) Subject: kselftest/filelock: use ksft_perror() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=47d020e2337461f8a2991a0dc301f10a71903710;p=thirdparty%2Flinux.git kselftest/filelock: use ksft_perror() Patch series "selftests/filelock: Make output more kselftestish", v4. This series makes the output from the ofdlocks test a bit easier for tooling to work with, and also ignores the generated file while we're here. This patch (of 3): The ofdlocks test reports some errors via perror() which does not produce KTAP output, convert to ksft_perror() which does. Link: https://lore.kernel.org/20260226-selftest-filelock-ktap-v4-0-db8ae192ff42@kernel.org Link: https://lore.kernel.org/20260226-selftest-filelock-ktap-v4-1-db8ae192ff42@kernel.org Signed-off-by: Mark Brown Cc: Jeff Layton Cc: Shuah Khan Signed-off-by: Andrew Morton --- diff --git a/tools/testing/selftests/filelock/ofdlocks.c b/tools/testing/selftests/filelock/ofdlocks.c index ff8d47fc373ad..2d3b06ce5e5ee 100644 --- a/tools/testing/selftests/filelock/ofdlocks.c +++ b/tools/testing/selftests/filelock/ofdlocks.c @@ -16,7 +16,7 @@ static int lock_set(int fd, struct flock *fl) fl->l_whence = SEEK_SET; ret = fcntl(fd, F_OFD_SETLK, fl); if (ret) - perror("fcntl()"); + ksft_perror("fcntl()"); return ret; } @@ -28,7 +28,7 @@ static int lock_get(int fd, struct flock *fl) fl->l_whence = SEEK_SET; ret = fcntl(fd, F_OFD_GETLK, fl); if (ret) - perror("fcntl()"); + ksft_perror("fcntl()"); return ret; }