system/FileDescriptor: no-op implementation of *CloseOnExec() on Windows

Fixes the NFS client build, closes #305.
This commit is contained in:
Max Kellermann 2018-07-13 18:16:39 +02:00
parent 680fdb0338
commit d4ce9c0df2
3 changed files with 10 additions and 5 deletions

View File

@ -90,11 +90,12 @@ public:
return SocketDescriptor(FileDescriptor::Undefined()); return SocketDescriptor(FileDescriptor::Undefined());
} }
using FileDescriptor::EnableCloseOnExec;
using FileDescriptor::DisableCloseOnExec;
#ifndef _WIN32 #ifndef _WIN32
using FileDescriptor::SetNonBlocking; using FileDescriptor::SetNonBlocking;
using FileDescriptor::SetBlocking; using FileDescriptor::SetBlocking;
using FileDescriptor::EnableCloseOnExec;
using FileDescriptor::DisableCloseOnExec;
using FileDescriptor::Duplicate; using FileDescriptor::Duplicate;
using FileDescriptor::Close; using FileDescriptor::Close;
#else #else

View File

@ -115,7 +115,10 @@ public:
static bool CreatePipe(FileDescriptor &r, FileDescriptor &w) noexcept; static bool CreatePipe(FileDescriptor &r, FileDescriptor &w) noexcept;
#ifndef _WIN32 #ifdef _WIN32
void EnableCloseOnExec() noexcept {}
void DisableCloseOnExec() noexcept {}
#else
static bool CreatePipeNonBlock(FileDescriptor &r, static bool CreatePipeNonBlock(FileDescriptor &r,
FileDescriptor &w) noexcept; FileDescriptor &w) noexcept;

View File

@ -97,14 +97,15 @@ public:
using FileDescriptor::SetNonBlocking; using FileDescriptor::SetNonBlocking;
using FileDescriptor::SetBlocking; using FileDescriptor::SetBlocking;
using FileDescriptor::EnableCloseOnExec;
using FileDescriptor::DisableCloseOnExec;
using FileDescriptor::Duplicate; using FileDescriptor::Duplicate;
using FileDescriptor::CheckDuplicate; using FileDescriptor::CheckDuplicate;
static bool CreatePipe(FileDescriptor &r, FileDescriptor &w); static bool CreatePipe(FileDescriptor &r, FileDescriptor &w);
#endif #endif
using FileDescriptor::EnableCloseOnExec;
using FileDescriptor::DisableCloseOnExec;
#ifdef USE_EVENTFD #ifdef USE_EVENTFD
using FileDescriptor::CreateEventFD; using FileDescriptor::CreateEventFD;
#endif #endif