mirror of
https://github.com/Zygo/bees.git
synced 2025-05-17 21:35:45 +02:00
fd: better error messages for pread/pwrite
Include file name and offset. Signed-off-by: Zygo Blaxell <bees@furryterror.org>
This commit is contained in:
parent
eb2630dee6
commit
95347a08bb
@ -362,7 +362,7 @@ namespace crucible {
|
|||||||
}
|
}
|
||||||
int rv = ::pwrite(fd, buf, size, offset);
|
int rv = ::pwrite(fd, buf, size, offset);
|
||||||
if (rv != static_cast<int>(size)) {
|
if (rv != static_cast<int>(size)) {
|
||||||
THROW_ERROR(runtime_error, "pwrite: only " << rv << " of " << size << " bytes written at offset " << offset);
|
THROW_ERROR(runtime_error, "pwrite: only " << rv << " of " << size << " bytes written at fd " << name_fd(fd) << " offset " << offset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -442,7 +442,7 @@ namespace crucible {
|
|||||||
THROW_ERRNO("pread: " << size << " bytes");
|
THROW_ERRNO("pread: " << size << " bytes");
|
||||||
}
|
}
|
||||||
if (rv != static_cast<int>(size)) {
|
if (rv != static_cast<int>(size)) {
|
||||||
THROW_ERROR(runtime_error, "pread: " << size << " bytes at offset " << offset << " returned " << rv);
|
THROW_ERROR(runtime_error, "pread: " << size << " bytes at fd " << name_fd(fd) << " offset " << offset << " returned " << rv);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user