From 1615b8551a3a73532ac234973cfb04dd8ed98ba4 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sun, 25 Feb 2024 02:27:26 +1100 Subject: util/ioprocs.cpp: Added wrappers for common patterns. (#11608) emu/diimage.h: Removed fread overloads that allocate memory for output. util/core_file.cpp: Changed output size of load to size_t. --- src/lib/util/harddisk.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/lib/util/harddisk.cpp') diff --git a/src/lib/util/harddisk.cpp b/src/lib/util/harddisk.cpp index 6eb12b38091..266e5d25a2b 100644 --- a/src/lib/util/harddisk.cpp +++ b/src/lib/util/harddisk.cpp @@ -16,6 +16,7 @@ #include "osdcore.h" #include +#include /*------------------------------------------------- @@ -118,7 +119,7 @@ bool hard_disk_file::read(uint32_t lbasector, void *buffer) size_t actual = 0; std::error_condition err = fhandle->seek(fileoffset + (lbasector * hdinfo.sectorbytes), SEEK_SET); if (!err) - err = fhandle->read(buffer, hdinfo.sectorbytes, actual); + std::tie(err, actual) = util::read(*fhandle, buffer, hdinfo.sectorbytes); return !err && (actual == hdinfo.sectorbytes); } } @@ -151,8 +152,8 @@ bool hard_disk_file::write(uint32_t lbasector, const void *buffer) size_t actual = 0; std::error_condition err = fhandle->seek(fileoffset + (lbasector * hdinfo.sectorbytes), SEEK_SET); if (!err) - err = fhandle->write(buffer, hdinfo.sectorbytes, actual); - return !err && (actual == hdinfo.sectorbytes); + std::tie(err, actual) = util::write(*fhandle, buffer, hdinfo.sectorbytes); + return !err; } } -- cgit v1.2.3-70-g09d2