mirror of
https://github.com/NixOS/nix
synced 2025-07-06 21:41:48 +02:00
Merge branch 'fix/avoid-large-stack-buffers' of https://github.com/dtzWill/nix
This commit is contained in:
commit
f87e286e82
5 changed files with 27 additions and 26 deletions
|
@ -4161,10 +4161,10 @@ 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)) {
|
||||
unsigned char buffer[4096];
|
||||
ssize_t rd = read(k, buffer, sizeof(buffer));
|
||||
ssize_t rd = read(k, buffer.data(), buffer.size());
|
||||
if (rd == -1) {
|
||||
if (errno != EINTR)
|
||||
throw SysError(format("reading from %1%")
|
||||
|
@ -4176,7 +4176,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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue