diff options
Diffstat (limited to 'src/libstore/build.cc')
-rw-r--r-- | src/libstore/build.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc index 1d611ffbaba5..b33649e6b4a5 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -4156,8 +4156,8 @@ void Worker::waitForInput() set<int> fds2(j->fds); for (auto & k : fds2) { if (FD_ISSET(k, &fds)) { - unsigned char buffer[4096]; - ssize_t rd = read(k, buffer, sizeof(buffer)); + std::vector<unsigned char> buffer(4096); + ssize_t rd = read(k, buffer.data(), buffer.size()); if (rd == -1) { if (errno != EINTR) throw SysError(format("reading from %1%") @@ -4169,7 +4169,7 @@ void Worker::waitForInput() } else { printMsg(lvlVomit, format("%1%: read %2% bytes") % goal->getName() % rd); - string data((char *) buffer, rd); + string data((char *) buffer.data(), rd); j->lastOutput = after; goal->handleChildOutput(k, data); } |