• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# This build file prints out a list of open file descriptors in
2# Ninja subprocesses, to help verify we don't accidentally leak
3# any.
4
5# Because one fd leak was in the code managing multiple subprocesses,
6# this test brings up multiple subprocesses and then dumps the fd
7# table of the last one.
8
9# Use like: ./ninja -f misc/inherited-fds.ninja
10
11rule sleep
12  command = sleep 10000
13
14rule dump
15  command = sleep 1; ls -l /proc/self/fd; exit 1
16
17build all: phony a b c d e
18
19build a: sleep
20build b: sleep
21build c: sleep
22build d: sleep
23build e: dump
24