system/FileDescriptor: new wrapper class for a file descriptor
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user