If using --log or -j > 1, disable stdin.

Parallelism and redo-log cause lots of confusion for any rules that try
to ask the user for questions, so disable it altogether.

Arguably, we should just disable stdin all the time, but maybe it's
still occasionally useful (even though you have to pass --no-log to get
it back).
This commit is contained in:
Avery Pennarun 2018-12-02 22:53:00 -05:00
commit 1966a0fac7
4 changed files with 17 additions and 4 deletions

View file

@ -22,9 +22,14 @@ def _try_stat(filename):
log_reader_pid = None
def close_stdin():
f = open('/dev/null')
os.dup2(f.fileno(), 0)
f.close()
def start_stdin_log_reader(status, details, pretty, color,
debug_locks, debug_pids):
if not vars.LOG: return
global log_reader_pid
r, w = os.pipe() # main pipe to redo-log
ar, aw = os.pipe() # ack pipe from redo-log --ack-fd