aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/fs/io/FileReader.hxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/fs/io/FileReader.hxx b/src/fs/io/FileReader.hxx
index eb0646015..53651380f 100644
--- a/src/fs/io/FileReader.hxx
+++ b/src/fs/io/FileReader.hxx
@@ -49,6 +49,20 @@ class FileReader final : public Reader {
public:
FileReader(Path _path, Error &error);
+#ifdef WIN32
+ FileReader(FileReader &&other)
+ :path(std::move(other.path)),
+ handle(other.handle) {
+ other.handle = INVALID_HANDLE_VALUE;
+ }
+#else
+ FileReader(FileReader &&other)
+ :path(std::move(other.path)),
+ fd(other.fd) {
+ other.fd.SetUndefined();
+ }
+#endif
+
~FileReader() {
if (IsDefined())
Close();