2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-18 01:52:17 +00:00

Do not read pipe content at available size peeking

Currently the same data is read twice.

The first time a buffer is filled by `PeekNamedPipe` and second time it is
overwritten with the same content by `ReadFile`.
This commit is contained in:
Nikita Kniazev
2018-10-11 23:21:23 +03:00
parent d13002a92d
commit e7e55d0cc9

View File

@@ -770,7 +770,7 @@ static void read_pipe
for (;;)
{
/* check if we have any data to read */
if ( !PeekNamedPipe( in, ioBuffer, IO_BUFFER_SIZE, &bytesInBuffer,
if ( !PeekNamedPipe( in, NULL, IO_BUFFER_SIZE, NULL,
&bytesAvailable, NULL ) || bytesAvailable == 0 )
return;