about summary refs log tree commit diff
diff options
context:
space:
mode:
authorWill Dietz <w@wdtz.org>2018-03-02T00·58-0600
committerWill Dietz <w@wdtz.org>2018-03-02T16·52-0600
commit6b9a03f5d878ae434b54bb883b51e28082dc30b3 (patch)
tree7fb2bb691217aee150ddd8dc2e78899d91813a78
parentc89a3d536891da84403b025c70f1ae225faa0eb2 (diff)
hoist vector out of loop just in case
-rw-r--r--src/libstore/build.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index b33649e6b4a5..a1654917dc30 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -4154,9 +4154,9 @@ void Worker::waitForInput()
         assert(goal);
 
         set<int> fds2(j->fds);
+        std::vector<unsigned char> buffer(4096);
         for (auto & k : fds2) {
             if (FD_ISSET(k, &fds)) {
-                std::vector<unsigned char> buffer(4096);
                 ssize_t rd = read(k, buffer.data(), buffer.size());
                 if (rd == -1) {
                     if (errno != EINTR)