]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
kselftest/filelock: use ksft_perror()
authorMark Brown <broonie@kernel.org>
Thu, 26 Feb 2026 16:05:25 +0000 (16:05 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 29 May 2026 04:24:43 +0000 (21:24 -0700)
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>
tools/testing/selftests/filelock/ofdlocks.c

index ff8d47fc373ad97a0e54737fe371c2f775fa2efd..2d3b06ce5e5eecad2f2bcae8ec45c7c9cdb8d403 100644 (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;
 }