From cc511fd65b7b6de9e87e72fb4bed16fc7efeb8b7 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 18 Dec 2012 18:50:05 +0100 Subject: [PATCH] Check for potential infinite select() loops when building --- src/libstore/build.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libstore/build.cc b/src/libstore/build.cc index ce87eaed2..035151bb2 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -3141,6 +3141,8 @@ void Worker::waitForInput() } } + assert(fdMax != 0); + if (select(fdMax, &fds, 0, 0, useTimeout ? &timeout : 0) == -1) { if (errno == EINTR) return; throw SysError("waiting for input");