diff options
Diffstat (limited to 'src/lib/file_group.cc')
| -rw-r--r-- | src/lib/file_group.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/file_group.cc b/src/lib/file_group.cc index 228faa74d..56a5c2c59 100644 --- a/src/lib/file_group.cc +++ b/src/lib/file_group.cc @@ -84,11 +84,13 @@ FileGroup::ensure_open_path (size_t p) const _current_file->close(); } - _current_path = p; - _current_file = dcp::File(_paths[_current_path], "rb"); - if (!_current_file) { - throw OpenFileError (_paths[_current_path], errno, OpenFileError::READ); + auto file = dcp::File(_paths[p], "rb"); + if (!file) { + throw OpenFileError(_paths[p], file.open_error(), OpenFileError::READ); } + + _current_path = p; + _current_file = std::move(file); _current_size = dcp::filesystem::file_size(_paths[_current_path]); } |
