summaryrefslogtreecommitdiff
path: root/src/fs/io/FileReader.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs/io/FileReader.cxx')
-rw-r--r--src/fs/io/FileReader.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/fs/io/FileReader.cxx b/src/fs/io/FileReader.cxx
index afc4e701c..1138d0b8d 100644
--- a/src/fs/io/FileReader.cxx
+++ b/src/fs/io/FileReader.cxx
@@ -21,6 +21,7 @@
#include "FileReader.hxx"
#include "fs/FileInfo.hxx"
#include "system/Error.hxx"
+#include "system/Open.hxx"
#include <assert.h>
@@ -88,11 +89,8 @@ FileReader::Close() noexcept
#else
FileReader::FileReader(Path _path)
- :path(_path)
+ :path(_path), fd(OpenReadOnly(path.c_str()))
{
- fd.OpenReadOnly(path.c_str());
- if (!fd.IsDefined())
- throw FormatErrno("Failed to open %s", path.ToUTF8().c_str());
}
FileInfo