Don't let stderr writes in substituters cause a deadlock

This commit is contained in:
Eelco Dolstra 2013-05-01 13:21:39 +02:00
parent 4ddd077bfa
commit 470553bd05

View file

@ -1007,6 +1007,10 @@ void LocalStore::startSubstituter(const Path & substituter, RunningSubstituter &
fromPipe.create(); fromPipe.create();
errorPipe.create(); errorPipe.create();
/* Hack: prevent substituters that write too much to stderr from
deadlocking our read() from stdout. */
fcntl(errorPipe.writeSide, F_SETFL, O_NONBLOCK);
setSubstituterEnv(); setSubstituterEnv();
run.pid = maybeVfork(); run.pid = maybeVfork();