mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-17 16:53:13 +00:00
Fixed bug in edge case write() logic
This commit is contained in:
@@ -1510,7 +1510,13 @@ ILibTransport_DoneState ILibProcessPipe_Pipe_Write(ILibProcessPipe_Pipe po, char
|
|||||||
if (result == TRUE) { retVal = ILibTransport_DoneState_COMPLETE; }
|
if (result == TRUE) { retVal = ILibTransport_DoneState_COMPLETE; }
|
||||||
#else
|
#else
|
||||||
int result = (int)write(pipeObject->mPipe_WriteEnd, buffer, bufferLen);
|
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
|
#endif
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user