diff options
author | Max Kellermann <max@musicpd.org> | 2017-08-11 09:19:00 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2017-08-11 09:19:00 +0200 |
commit | 7a4457402f9c79b6b4d661318be26faf3fb16079 (patch) | |
tree | dfd36c0794215c0f75187e137f2ff254c143f7a6 /src | |
parent | 9056dcaf7d9234977362f3219e27fb997f174f52 (diff) |
system/EventPipe: use FileDescriptor::CreatePipeNonBlock()
Diffstat (limited to 'src')
-rw-r--r-- | src/system/EventPipe.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/system/EventPipe.cxx b/src/system/EventPipe.cxx index b38b986f6..8de9cecac 100644 --- a/src/system/EventPipe.cxx +++ b/src/system/EventPipe.cxx @@ -19,7 +19,7 @@ #include "config.h" #include "EventPipe.hxx" -#include "system/fd_util.h" +#include "FileDescriptor.hxx" #include "system/Error.hxx" #include "util/ScopeExit.hxx" #include "Compiler.h" @@ -43,8 +43,12 @@ EventPipe::EventPipe() #ifdef WIN32 PoorSocketPair(fds); #else - if (pipe_cloexec_nonblock(fds) < 0) + FileDescriptor r, w; + if (!FileDescriptor::CreatePipeNonBlock(r, w)) throw MakeErrno("pipe() has failed"); + + fds[0] = r.Steal(); + fds[1] = r.Steal(); #endif } |