fs/io/FileOutputStream: use class FileDescriptor

This commit is contained in:
Max Kellermann
2015-03-03 22:18:38 +01:00
parent dd4beea44c
commit cd08e5c7da
2 changed files with 20 additions and 19 deletions

View File

@@ -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 FileOutputStream final : public OutputStream {
#ifdef WIN32
HANDLE handle;
#else
int fd;
FileDescriptor fd;
#endif
#ifdef HAVE_LINKAT
@@ -64,7 +68,7 @@ public:
#ifdef WIN32
return handle != INVALID_HANDLE_VALUE;
#else
return fd >= 0;
return fd.IsDefined();
#endif
}