make sure that bytes only get added to bytesRead when bytes > 0
This commit is contained in:
parent
cd25d42d66
commit
112d7fe632
|
@ -175,7 +175,8 @@ ACTOR Future<int> spawnProcess(std::string path,
|
|||
loop {
|
||||
int bytes =
|
||||
read(readFD.get(), &outputBuffer[bytesRead], SERVER_KNOBS->MAX_FORKED_PROCESS_OUTPUT - bytesRead);
|
||||
bytesRead += bytes;
|
||||
if (bytes > 0)
|
||||
bytesRead += bytes;
|
||||
if (bytes < 0 && errno == EAGAIN)
|
||||
break;
|
||||
else if (bytes < 0)
|
||||
|
|
Loading…
Reference in New Issue