summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-12-23 20:16:07 +0100
committerCarl Hetherington <cth@carlh.net>2022-12-23 20:16:07 +0100
commit4947d7260fa164d5f47cfb688d029a0fd6ab9967 (patch)
treea282f624c5a685a0c90cf4f1b5a924337755987a /src/lib
parentab108b87e1059720264432165a921ab3b259e0a6 (diff)
FIXME: use new libdcp open_error API.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/file_group.cc2
-rw-r--r--src/lib/film.cc2
-rw-r--r--src/lib/string_text_file.cc2
-rw-r--r--src/lib/util.cc8
-rw-r--r--src/lib/writer.cc2
5 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/file_group.cc b/src/lib/file_group.cc
index 5a73d66b8..a19c997e5 100644
--- a/src/lib/file_group.cc
+++ b/src/lib/file_group.cc
@@ -85,8 +85,8 @@ FileGroup::ensure_open_path (size_t p) const
_current_path = p;
_current_file = dcp::File(_paths[_current_path], "rb");
- throw OpenFileError (_paths[_current_path], errno, OpenFileError::READ);
if (!_current_file->get()) {
+ throw OpenFileError(_paths[_current_path], _current_file->open_error(), OpenFileError::READ);
}
_current_size = boost::filesystem::file_size (_paths[_current_path]);
}
diff --git a/src/lib/film.cc b/src/lib/film.cc
index 399bd3da3..cdbdcac99 100644
--- a/src/lib/film.cc
+++ b/src/lib/film.cc
@@ -2083,7 +2083,7 @@ InfoFileHandle::InfoFileHandle (boost::mutex& mutex, boost::filesystem::path pat
, _file (path, read ? "rb" : (boost::filesystem::exists(path) ? "r+b" : "wb"))
{
if (!_file) {
- throw OpenFileError (path, errno, read ? OpenFileError::READ : (boost::filesystem::exists(path) ? OpenFileError::READ_WRITE : OpenFileError::WRITE));
+ throw OpenFileError(path, _file.open_error(), read ? OpenFileError::READ : (boost::filesystem::exists(path) ? OpenFileError::READ_WRITE : OpenFileError::WRITE));
}
}
diff --git a/src/lib/string_text_file.cc b/src/lib/string_text_file.cc
index 869a2c96a..a93ba6948 100644
--- a/src/lib/string_text_file.cc
+++ b/src/lib/string_text_file.cc
@@ -56,7 +56,7 @@ StringTextFile::StringTextFile (shared_ptr<const StringTextFileContent> content)
if (ext == ".stl") {
dcp::File f(content->path(0), "rb");
if (!f) {
- throw OpenFileError (f.path(), errno, OpenFileError::READ);
+ throw OpenFileError(f.path(), f.open_error(), OpenFileError::READ);
}
try {
reader.reset(new sub::STLBinaryReader(f.get()));
diff --git a/src/lib/util.cc b/src/lib/util.cc
index 086a99f24..ddcc8e3de 100644
--- a/src/lib/util.cc
+++ b/src/lib/util.cc
@@ -498,7 +498,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);
}
boost::uintmax_t this_time = min (to_do, boost::filesystem::file_size (files[i]));
@@ -517,7 +517,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);
}
boost::uintmax_t this_time = min (to_do, boost::filesystem::file_size (files[i]));
@@ -892,11 +892,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 */
diff --git a/src/lib/writer.cc b/src/lib/writer.cc
index 2e732c280..88cfaeae0 100644
--- a/src/lib/writer.cc
+++ b/src/lib/writer.cc
@@ -712,7 +712,7 @@ Writer::write_cover_sheet (boost::filesystem::path output_dcp)
auto const cover = film()->file("COVER_SHEET.txt");
dcp::File f(cover, "w");
if (!f) {
- throw OpenFileError (cover, errno, OpenFileError::WRITE);
+ throw OpenFileError(cover, f.open_error(), OpenFileError::WRITE);
}
auto text = Config::instance()->cover_sheet ();