diff options
author | 2024-06-22 03:54:51 +1000 | |
---|---|---|
committer | 2024-06-22 03:54:51 +1000 | |
commit | 0e459c17f59283d70c774ad74189165c433c7815 (patch) | |
tree | 43ef183ed8c58e8ea43eeca78043a79f532550ab /src/lib/util/ioprocs.cpp | |
parent | 8e902a47e6c8972d94196b7627d01ea5966f1716 (diff) |
-machine/atastorage.cpp: Log disk geometry at verbose level (rather than debug) so it can be shown in release builds.
* Also use logmacro.h for compile-time configurable logging.
-util/ioprocs.cpp: Added assertion to write_at equivalent to the one in write.
* Checks for invalid results from underlying write call.
* Also more const.
Diffstat (limited to 'src/lib/util/ioprocs.cpp')
-rw-r--r-- | src/lib/util/ioprocs.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/util/ioprocs.cpp b/src/lib/util/ioprocs.cpp index 583cae1d1de..687968f85ee 100644 --- a/src/lib/util/ioprocs.cpp +++ b/src/lib/util/ioprocs.cpp @@ -795,7 +795,7 @@ std::pair<std::error_condition, std::size_t> write(write_stream &stream, void co do { std::size_t written; - std::error_condition err = stream.write_some(buffer, length, written); + std::error_condition const err = stream.write_some(buffer, length, written); assert(written || err || !length); actual += written; if (err && (std::errc::interrupted != err)) @@ -813,7 +813,8 @@ std::pair<std::error_condition, std::size_t> write_at(random_write &stream, std: do { std::size_t written; - std::error_condition err = stream.write_some_at(offset, buffer, length, written); + std::error_condition const err = stream.write_some_at(offset, buffer, length, written); + assert(written || err || !length); actual += written; if (err && (std::errc::interrupted != err)) return std::make_pair(err, actual); |