1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-15 15:53:55 +00:00

Fixed bug in edge case write() logic

This commit is contained in:
Bryan Roe
2021-08-23 23:48:02 -07:00
parent 758b6b5cc1
commit 667bb3103d

View File

@@ -1510,7 +1510,13 @@ ILibTransport_DoneState ILibProcessPipe_Pipe_Write(ILibProcessPipe_Pipe po, char
if (result == TRUE) { retVal = ILibTransport_DoneState_COMPLETE; }
#else
int result = (int)write(pipeObject->mPipe_WriteEnd, buffer, bufferLen);
if (result > 0) { retVal = ILibTransport_DoneState_COMPLETE; }
while (result >= 0 && result < bufferLen)
{
buffer += result;
bufferLen -= result;
result = (int)write(pipeObject->mPipe_WriteEnd, buffer, bufferLen);
}
if (result == bufferLen) { retVal = ILibTransport_DoneState_COMPLETE; }
#endif
else
{