Commit 7a445740 authored by Max Kellermann's avatar Max Kellermann

system/EventPipe: use FileDescriptor::CreatePipeNonBlock()

parent 9056dcaf
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include "config.h" #include "config.h"
#include "EventPipe.hxx" #include "EventPipe.hxx"
#include "system/fd_util.h" #include "FileDescriptor.hxx"
#include "system/Error.hxx" #include "system/Error.hxx"
#include "util/ScopeExit.hxx" #include "util/ScopeExit.hxx"
#include "Compiler.h" #include "Compiler.h"
...@@ -43,8 +43,12 @@ EventPipe::EventPipe() ...@@ -43,8 +43,12 @@ EventPipe::EventPipe()
#ifdef WIN32 #ifdef WIN32
PoorSocketPair(fds); PoorSocketPair(fds);
#else #else
if (pipe_cloexec_nonblock(fds) < 0) FileDescriptor r, w;
if (!FileDescriptor::CreatePipeNonBlock(r, w))
throw MakeErrno("pipe() has failed"); throw MakeErrno("pipe() has failed");
fds[0] = r.Steal();
fds[1] = r.Steal();
#endif #endif
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment