diff --git a/src/fs/io/FileReader.hxx b/src/fs/io/FileReader.hxx index 661682822..8ec79337d 100644 --- a/src/fs/io/FileReader.hxx +++ b/src/fs/io/FileReader.hxx @@ -28,7 +28,7 @@ #ifdef _WIN32 #include #else -#include "system/FileDescriptor.hxx" +#include "system/UniqueFileDescriptor.hxx" #endif class Path; @@ -40,7 +40,7 @@ class FileReader final : public Reader { #ifdef _WIN32 HANDLE handle; #else - FileDescriptor fd; + UniqueFileDescriptor fd; #endif public: @@ -50,18 +50,16 @@ public: FileReader(FileReader &&other) noexcept :path(std::move(other.path)), handle(std::exchange(other.handle, INVALID_HANDLE_VALUE)) {} -#else - FileReader(FileReader &&other) noexcept - :path(std::move(other.path)), - fd(other.fd) { - other.fd.SetUndefined(); - } -#endif ~FileReader() noexcept { if (IsDefined()) Close(); } +#else + FileReader(FileReader &&other) noexcept + :path(std::move(other.path)), + fd(std::move(other.fd)) {} +#endif protected: