Ensure good exit status from type

When looking to see if nproc is available we do
not want warnings about 'type nproc' having bad exit.
This commit is contained in:
Simon J. Gerraty 2023-04-22 23:15:05 -07:00
parent b658c0fce1
commit d7e3299f60

View File

@ -62,7 +62,7 @@ _PREMK_LIBDIR:= ${LIBDIR}
.if make(*-jobs) && empty(JOB_MAX)
# provide a reasonable? default for JOB_MAX based on ncpu
JOB_MAX_FACTOR?= 1.33
NPROC?= ${(type nproc) 2> /dev/null:L:sh:M/*:[1]}
NPROC?= ${(type nproc || true) 2> /dev/null:L:sh:M/*:[1]}
NPROC:= ${NPROC}
.if !empty(NPROC)
ncpu!= ${NPROC}