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 <broonie@kernel.org>
Cc: Jeff Layton <jlayton@kernel.org>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
Mark Brown 2026-02-26 16:05:25 +00:00 committed by Andrew Morton
parent f424800c2a
commit 47d020e233

View File

@ -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;
}