summaryrefslogtreecommitdiff
path: root/src/lib/util.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-09-03 17:55:11 +0200
committerCarl Hetherington <cth@carlh.net>2024-09-03 17:55:19 +0200
commit4049ec5e8bdddbc48689521a26bf47236c2b490d (patch)
tree6532546b5a1edcd77e8824d8cd854eac13e38c44 /src/lib/util.cc
parent5db3eda9c6f0d6b027263c519000997677253504 (diff)
Fix a few places where we should use dcp::File::open_error()
to get a more accurate error number on Windows.
Diffstat (limited to 'src/lib/util.cc')
-rw-r--r--src/lib/util.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/util.cc b/src/lib/util.cc
index f637534a9..8b767cd15 100644
--- a/src/lib/util.cc
+++ b/src/lib/util.cc
@@ -559,7 +559,7 @@ digest_head_tail (vector<boost::filesystem::path> files, boost::uintmax_t size)
while (i < int64_t (files.size()) && to_do > 0) {
dcp::File f(files[i], "rb");
if (!f) {
- throw OpenFileError (files[i].string(), errno, OpenFileError::READ);
+ throw OpenFileError(files[i].string(), f.open_error(), OpenFileError::READ);
}
auto this_time = min(to_do, dcp::filesystem::file_size(files[i]));
@@ -578,7 +578,7 @@ digest_head_tail (vector<boost::filesystem::path> files, boost::uintmax_t size)
while (i >= 0 && to_do > 0) {
dcp::File f(files[i], "rb");
if (!f) {
- throw OpenFileError (files[i].string(), errno, OpenFileError::READ);
+ throw OpenFileError(files[i].string(), f.open_error(), OpenFileError::READ);
}
auto this_time = min(to_do, dcp::filesystem::file_size(files[i]));
@@ -956,11 +956,11 @@ copy_in_bits (boost::filesystem::path from, boost::filesystem::path to, std::fun
{
dcp::File f(from, "rb");
if (!f) {
- throw OpenFileError (from, errno, OpenFileError::READ);
+ throw OpenFileError(from, f.open_error(), OpenFileError::READ);
}
dcp::File t(to, "wb");
if (!t) {
- throw OpenFileError (to, errno, OpenFileError::WRITE);
+ throw OpenFileError(to, t.open_error(), OpenFileError::WRITE);
}
/* on the order of a second's worth of copying */