Kill builds when we get EOF on the log FD

This closes a long-time bug that allowed builds to hang Nix
indefinitely (regardless of timeouts) simply by doing

  exec > /dev/null 2>&1; while true; do true; done

Now, on EOF, we just send SIGKILL to the child to make sure it's
really gone.
This commit is contained in:
Eelco Dolstra 2017-01-19 16:58:39 +01:00
parent 63e10b4d28
commit 21948deed9
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
6 changed files with 40 additions and 40 deletions

View file

@ -333,7 +333,7 @@ RunPager::~RunPager()
if (pid != -1) {
std::cout.flush();
close(STDOUT_FILENO);
pid.wait(true);
pid.wait();
}
} catch (...) {
ignoreException();