Make terminate_threads() less likely to leave _threads containing invalid pointers.
[dcpomatic.git] / src / lib / file_group.cc
index e18b9824e27181543ab271546ac6853d985f90a9..3e8a7b79c43177a8d775889ab91d08855bb0e77e 100644 (file)
@@ -93,7 +93,7 @@ FileGroup::ensure_open_path (size_t p) const
        _current_path = p;
        _current_file = fopen_boost (_paths[_current_path], "rb");
        if (_current_file == 0) {
-               throw OpenFileError (_paths[_current_path], errno, true);
+               throw OpenFileError (_paths[_current_path], errno, OpenFileError::READ);
        }
 }
 
@@ -162,7 +162,7 @@ FileGroup::read (uint8_t* buffer, int amount) const
                        break;
                }
 
-               if (ferror(_current_file) && errno != EAGAIN) {
+               if (ferror(_current_file)) {
                        throw FileError (String::compose("fread error %1", errno), _paths[_current_path]);
                }