1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-13 01:00:23 +02:00

Add ioCopy().

Functionality to copy from IoRead to IoWrite is frequently used so centralize it. This also simplifies coverage testing in places where a loop was required before.
This commit is contained in:
David Steele
2022-01-09 13:19:43 -05:00
parent 47954774c6
commit 5f78a5fc18
7 changed files with 51 additions and 36 deletions

View File

@ -271,15 +271,7 @@ testRun(void)
\
uint64_t benchMarkBegin = timeMSec(); \
\
Buffer *buffer = bufNew(ioBufferSize()); \
\
do \
{ \
ioRead(read, buffer); \
ioWrite(write, buffer); \
bufUsedZero(buffer); \
} \
while (!ioReadEof(read)); \
ioCopy(read, write); \
\
ioReadClose(read); \
ioWriteClose(write); \