diff options
author | Max Kellermann <max@duempel.org> | 2015-03-03 17:03:21 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2015-03-03 17:14:30 +0100 |
commit | 40a587bbaff38bb0b60313c24b94e2ecd53b181c (patch) | |
tree | d72c9db82e0db482ebe054119460b506433e9d05 /src/fs/io/FileReader.hxx | |
parent | 818d729d8b60a682e267ac408c710f5851389d79 (diff) | |
download | mpd-40a587bbaff38bb0b60313c24b94e2ecd53b181c.tar.gz mpd-40a587bbaff38bb0b60313c24b94e2ecd53b181c.tar.xz mpd-40a587bbaff38bb0b60313c24b94e2ecd53b181c.zip |
system/FileDescriptor: new wrapper class for a file descriptor
Diffstat (limited to 'src/fs/io/FileReader.hxx')
-rw-r--r-- | src/fs/io/FileReader.hxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/fs/io/FileReader.hxx b/src/fs/io/FileReader.hxx index 9a1c17c6b..eb0646015 100644 --- a/src/fs/io/FileReader.hxx +++ b/src/fs/io/FileReader.hxx @@ -25,6 +25,10 @@ #include "fs/AllocatedPath.hxx" #include "Compiler.h" +#ifndef WIN32 +#include "system/FileDescriptor.hxx" +#endif + #include <assert.h> #ifdef WIN32 @@ -39,7 +43,7 @@ class FileReader final : public Reader { #ifdef WIN32 HANDLE handle; #else - int fd; + FileDescriptor fd; #endif public: @@ -55,7 +59,7 @@ public: #ifdef WIN32 return handle != INVALID_HANDLE_VALUE; #else - return fd >= 0; + return fd.IsDefined(); #endif } |