Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

scripts/jobserver-exec: parse the last --jobserver-auth= option

In the GNU Make manual, the section "Sharing Job Slots with GNU make"
says:

Be aware that the MAKEFLAGS variable may contain multiple instances
of the --jobserver-auth= option. Only the last instance is relevant.

Take the last element of the array, not the first.

Link: https://www.gnu.org/software/make/manual/html_node/Job-Slots.html
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>

+3 -1
+3 -1
scripts/jobserver-exec
··· 23 23 opts = [x for x in flags.split(" ") if x.startswith("--jobserver")] 24 24 25 25 # Parse out R,W file descriptor numbers and set them nonblocking. 26 - fds = opts[0].split("=", 1)[1] 26 + # If the MAKEFLAGS variable contains multiple instances of the 27 + # --jobserver-auth= option, the last one is relevant. 28 + fds = opts[-1].split("=", 1)[1] 27 29 reader, writer = [int(x) for x in fds.split(",", 1)] 28 30 # Open a private copy of reader to avoid setting nonblocking 29 31 # on an unexpecting process with the same reader fd.