1
0
Fork 0

Merging upstream version 1.0.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-24 05:42:37 +01:00
parent 997ce2ad42
commit 34b309ae87
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
16 changed files with 84 additions and 79 deletions

View file

@ -54,13 +54,13 @@ int readblock( const int fd, uint8_t * const buf, const int size )
errno = 0;
while( rest > 0 )
{
errno = 0;
const int n = read( fd, buf + size - rest, rest );
if( n > 0 ) rest -= n;
else if( n == 0 ) break; // EOF
else if( errno != EINTR && errno != EAGAIN ) break;
errno = 0;
}
return ( rest > 0 ) ? size - rest : size;
return size - rest;
}
@ -73,12 +73,12 @@ int writeblock( const int fd, const uint8_t * const buf, const int size )
errno = 0;
while( rest > 0 )
{
errno = 0;
const int n = write( fd, buf + size - rest, rest );
if( n > 0 ) rest -= n;
else if( n < 0 && errno != EINTR && errno != EAGAIN ) break;
errno = 0;
}
return ( rest > 0 ) ? size - rest : size;
return size - rest;
}