mirror of
https://github.com/AltraMayor/f3.git
synced 2025-09-13 09:06:56 -04:00
f3probe: make read_all() return negative errors
bdev_read_block(), who calls read_all(), is expected to return negative errors.
This commit is contained in:
parent
ac2d89a0b9
commit
8001dfdadd
@ -322,7 +322,7 @@ static int read_all(int fd, char *buf, int count)
|
|||||||
ssize_t rc = read(fd, buf + done, count - done);
|
ssize_t rc = read(fd, buf + done, count - done);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
assert(errno == EIO);
|
assert(errno == EIO);
|
||||||
return errno;
|
return - errno;
|
||||||
}
|
}
|
||||||
assert(rc != 0); /* We should never hit the end of the file. */
|
assert(rc != 0); /* We should never hit the end of the file. */
|
||||||
done += rc;
|
done += rc;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user