From 21948deed99a3295e4d5666e027a6ca42dc00b40 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 19 Jan 2017 16:58:39 +0100 Subject: 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. --- src/libmain/shared.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libmain/shared.cc') diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc index 44579a236774..12f083c7f794 100644 --- a/src/libmain/shared.cc +++ b/src/libmain/shared.cc @@ -333,7 +333,7 @@ RunPager::~RunPager() if (pid != -1) { std::cout.flush(); close(STDOUT_FILENO); - pid.wait(true); + pid.wait(); } } catch (...) { ignoreException(); -- cgit 1.4.1