1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

[292127] Reading process output blocked when message length is exactly 1024, patch by Thierry Goldwaser

This commit is contained in:
Anton Leherbauer 2009-10-16 09:06:14 +00:00
parent 54d204a985
commit 5e58b2deb1
2 changed files with 9 additions and 0 deletions

View file

@ -145,6 +145,15 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_rea
nBuffOffset += nNumberOfBytesRead;
if(nNumberOfBytesRead != nNumberOfBytesToRead)
break;
else
{
// Is there data left in the pipe?
DWORD bytesAvailable = 0;
if (!::PeekNamedPipe((HANDLE)fd, NULL, 0, NULL, &bytesAvailable, NULL)
|| bytesAvailable == 0)
// No bytes left
break;
}
}
CloseHandle(overlapped.hEvent);
#ifdef DEBUG_MONITOR