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.
This commit is contained in:
Avery Pennarun 2010-12-10 04:11:44 -08:00
commit 675a5106d2

View file

@ -70,7 +70,11 @@ def setup(maxjobs):
if maxjobs and not _fds: if maxjobs and not _fds:
# need to start a new server # need to start a new server
_toplevel = maxjobs _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) _release(maxjobs-1)
os.putenv('MAKEFLAGS', os.putenv('MAKEFLAGS',
'%s --jobserver-fds=%d,%d -j' % (os.getenv('MAKEFLAGS'), '%s --jobserver-fds=%d,%d -j' % (os.getenv('MAKEFLAGS'),