[PATCH] build: make _make_dirs robust against too long argument error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



_make_dirs currently can fail as _DIRS can be really long and thus go over
the MAX_ARG_STRLEN limit so it will fail with:
/bin/sh: Argument list too long

Lets avoid this by stripping the $(BUILDDIR) prefix and then restoring it.

Signed-off-by: Robert Marko <robimarko@xxxxxxxxx>
---
 src/build.rules | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/build.rules b/src/build.rules
index acda88472..497580d88 100644
--- a/src/build.rules
+++ b/src/build.rules
@@ -80,7 +80,7 @@ endif
 _DIRS := $(BUILDDIR)/$(PROJ)
 .PHONY: _make_dirs
 _make_dirs:
-	@mkdir -p $(_DIRS)
+	@printf '$(BUILDDIR)/%s ' $(patsubst $(BUILDDIR)/%,%,$(_DIRS)) | xargs mkdir -p
 
 $(BUILDDIR)/$(PROJ)/src/%.o: $(ROOTDIR)src/%.c $(CONFIG_FILE) | _make_dirs
 	$(Q)$(CC) -c -o $@ $(CFLAGS) $<
-- 
2.44.0


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux