]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
No flock on macOS
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 27 Oct 2021 19:19:29 +0000 (15:19 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 27 Oct 2021 19:19:29 +0000 (15:19 -0400)
src/bin/fuzzer.mk

index ad30eeb6a06f6cf4283a5c042387b02817b39e7f..68e905666df16e3925201e0ec085653eb0c1068b 100644 (file)
@@ -22,19 +22,20 @@ SOURCES             := fuzzer.c
 
 TGT_PREREQS    := libfreeradius-$(PROTOCOL).a
 
-TGT_LDLIBS     := $(LIBS) 
+TGT_LDLIBS     := $(LIBS)
 
 #
 #  Ensure that the large data file is copied from git-lfs,
 #  and then the files are extracted.
 #
 #  git-lfs fails to update the git index when multiple instances run
-#  concurrently.
+#  concurrently.  Unfortunately there's no equivalent command on macOS.
 #
 .PHONY:src/tests/fuzzer-corpus/$(PROTOCOL)
 src/tests/fuzzer-corpus/$(PROTOCOL):
        ${Q}if [ ! -e $@ ]; then \
-               flock -F /tmp/git-lfs-mutex git -c 'lfs.fetchexclude=' -c 'lfs.fetchinclude=src/tests/fuzzer-corpus/$(PROTOCOL).tar' lfs pull; \
+               if which -s flock; then flock -F /tmp/git-lfs-mutex git -c 'lfs.fetchexclude=' -c 'lfs.fetchinclude=src/tests/fuzzer-corpus/$(PROTOCOL).tar' lfs pull; \
+               else git -c 'lfs.fetchexclude=' -c 'lfs.fetchinclude=src/tests/fuzzer-corpus/$(PROTOCOL).tar' lfs pull; fi; \
                cd src/tests/fuzzer-corpus; \
                tar -xf $(PROTOCOL).tar; \
        fi