diff --git a/Makefile.config b/Makefile.config index 86c2d0e44..caed07b73 100644 --- a/Makefile.config +++ b/Makefile.config @@ -128,8 +128,12 @@ endif MAKE := $(MAKE) INTERACTIVE=$(INTERACTIVE) -# 9999999 PIDs ought to be enough for anybody, but check if pid_max can be found just in case -MAX_PID_SIZE = $(shell echo $$(( $$(wc -m < /proc/sys/kernel/pid_max 2>/dev/null) - 1 )) || echo 7) +# check if pid_max can be found else default to whatever +KERNEL_PID_MAX_FILE = /proc/sys/kernel/pid_max +MAX_PID_SIZE = $(shell \ + [ -r $(KERNEL_PID_MAX_FILE) ] \ + && echo $$(( $$(wc -m < $(KERNEL_PID_MAX_FILE)) - 1 )) \ + || echo 5) # Arguments: # $(1) is a string describing the command