]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
flock: (test) Only test fcntl vs flock on Linux
authorThomas Weißschuh <thomas@t-8ch.de>
Sun, 12 Apr 2026 06:12:29 +0000 (08:12 +0200)
committerThomas Weißschuh <thomas@t-8ch.de>
Tue, 28 Apr 2026 08:31:52 +0000 (10:31 +0200)
On other operating systems fcntl and flock may not actually be
independent, failing the test. This happens for example on macOS.

Only run this subtest on Linux.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
tests/ts/flock/flock

index 3223f8a20a868fea9c5eba83876b26c4bcfd87cb..004a6b532a2150d99bf7f147bb062a0d6c0521bb 100755 (executable)
@@ -108,7 +108,7 @@ for api in flock fcntl ; do
        ts_finalize_subtest
 
        # fcntl locks are independent of flock locks, so we should be able to get an exclusive flock lock.
-       if [ "$api" = "fcntl" ] ; then
+       if [ "$(uname -s)" = "Linux" ] && [ "$api" = "fcntl" ] ; then
                ts_init_subtest "fcntl-vs-flock"
                do_lock "--nonblock --exclusive" 0 "flock vs fcntl"
                ts_finalize_subtest