system/FileDescriptor: fix WIN32 checks
This commit is contained in:
@@ -33,7 +33,7 @@
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
|
||||||
#ifdef HAVE_POSIX
|
#ifndef WIN32
|
||||||
#include <poll.h>
|
#include <poll.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -72,7 +72,7 @@ FileDescriptor::OpenReadOnly(const char *pathname)
|
|||||||
return Open(pathname, O_RDONLY | O_NOCTTY | O_CLOEXEC);
|
return Open(pathname, O_RDONLY | O_NOCTTY | O_CLOEXEC);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_POSIX
|
#ifndef WIN32
|
||||||
|
|
||||||
bool
|
bool
|
||||||
FileDescriptor::OpenNonBlocking(const char *pathname)
|
FileDescriptor::OpenNonBlocking(const char *pathname)
|
||||||
@@ -188,7 +188,7 @@ FileDescriptor::GetSize() const
|
|||||||
: -1;
|
: -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_POSIX
|
#ifndef WIN32
|
||||||
|
|
||||||
int
|
int
|
||||||
FileDescriptor::Poll(short events, int timeout) const
|
FileDescriptor::Poll(short events, int timeout) const
|
||||||
|
@@ -93,7 +93,7 @@ public:
|
|||||||
bool Open(const char *pathname, int flags);
|
bool Open(const char *pathname, int flags);
|
||||||
bool OpenReadOnly(const char *pathname);
|
bool OpenReadOnly(const char *pathname);
|
||||||
|
|
||||||
#ifdef HAVE_POSIX
|
#ifndef WIN32
|
||||||
bool OpenNonBlocking(const char *pathname);
|
bool OpenNonBlocking(const char *pathname);
|
||||||
|
|
||||||
static bool CreatePipe(FileDescriptor &r, FileDescriptor &w);
|
static bool CreatePipe(FileDescriptor &r, FileDescriptor &w);
|
||||||
@@ -160,7 +160,7 @@ public:
|
|||||||
return ::write(fd, buffer, length);
|
return ::write(fd, buffer, length);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_POSIX
|
#ifndef WIN32
|
||||||
int Poll(short events, int timeout) const;
|
int Poll(short events, int timeout) const;
|
||||||
|
|
||||||
int WaitReadable(int timeout) const;
|
int WaitReadable(int timeout) const;
|
||||||
|
Reference in New Issue
Block a user