You've already forked pgbackrest
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:
@ -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); \
|
||||
|
Reference in New Issue
Block a user