summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2019-11-21 23:59:27 +0300
committerJonathan Corbet <corbet@lwn.net>2019-11-22 20:35:11 +0300
commit4920323cffc0fe10ac107ab3e94d1bd218a678d9 (patch)
tree95facc81a5c5ddda7addb2a42ecf8a1bdd66966a /scripts
parente3fedd570dedc0cde6240aff7a2bf62043b67ce9 (diff)
downloadlinux-4920323cffc0fe10ac107ab3e94d1bd218a678d9.tar.xz
docs, parallelism: Fix failure path and add comment
Rasmus noted that the failure path didn't correctly exit. Fix this and add another comment about GNU Make's job server environment variable names over time. Reported-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Link: https://lore.kernel.org/lkml/eb25959a-9ec4-3530-2031-d9d716b40b20@rasmusvillemoes.dk Signed-off-by: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/r/20191121205929.40371-2-keescook@chromium.org Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/jobserver-count3
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/jobserver-count b/scripts/jobserver-count
index 0b482d6884d2..6e15b38df3d0 100755
--- a/scripts/jobserver-count
+++ b/scripts/jobserver-count
@@ -24,6 +24,8 @@ try:
flags = os.environ['MAKEFLAGS']
# Look for "--jobserver=R,W"
+ # Note that GNU Make has used --jobserver-fds and --jobserver-auth
+ # so this handles all of them.
opts = [x for x in flags.split(" ") if x.startswith("--jobserver")]
# Parse out R,W file descriptor numbers and set them nonblocking.
@@ -53,6 +55,7 @@ os.write(writer, jobs)
# If the jobserver was (impossibly) full or communication failed, use default.
if len(jobs) < 1:
print(default)
+ sys.exit(0)
# Report available slots (with a bump for our caller's reserveration).
print(len(jobs) + 1)