From 675a5106d2588b9e6ec7dde0d114ec486f0e8d8f Mon Sep 17 00:00:00 2001 From: Avery Pennarun Date: Fri, 10 Dec 2010 04:11:44 -0800 Subject: [PATCH] dup() the jobserver fds to 100,101 to make debugging a bit easier. Now if a process is stuck waiting on one of those fds, it'll be obvious from the strace. --- jwack.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jwack.py b/jwack.py index e8bef68..2876094 100644 --- a/jwack.py +++ b/jwack.py @@ -70,7 +70,11 @@ def setup(maxjobs): if maxjobs and not _fds: # need to start a new server _toplevel = maxjobs - _fds = os.pipe() + _fds1 = os.pipe() + _fds = (fcntl.fcntl(_fds1[0], fcntl.F_DUPFD, 100), + fcntl.fcntl(_fds1[1], fcntl.F_DUPFD, 101)) + os.close(_fds1[0]) + os.close(_fds1[1]) _release(maxjobs-1) os.putenv('MAKEFLAGS', '%s --jobserver-fds=%d,%d -j' % (os.getenv('MAKEFLAGS'),