diff options
author | Max Kellermann <max@musicpd.org> | 2018-08-20 17:04:43 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2018-08-20 17:04:43 +0200 |
commit | 795baed3f5c56a9a05c046b7ddd6d93eba39a560 (patch) | |
tree | a77dc68466d357d60f982342f99e9b886c8a6b93 /src | |
parent | 5487d40be92d0944f44621c0bd4568ee5d66701f (diff) |
system/FileDescriptor: make pipe2() mandatory on Linux
Diffstat (limited to 'src')
-rw-r--r-- | src/system/FileDescriptor.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/system/FileDescriptor.cxx b/src/system/FileDescriptor.cxx index 920b8d06a..8f7f78e99 100644 --- a/src/system/FileDescriptor.cxx +++ b/src/system/FileDescriptor.cxx @@ -120,7 +120,7 @@ FileDescriptor::CreatePipe(FileDescriptor &r, FileDescriptor &w) noexcept { int fds[2]; -#ifdef HAVE_PIPE2 +#ifdef __linux__ const int flags = O_CLOEXEC; const int result = pipe2(fds, flags); #elif defined(_WIN32) @@ -145,7 +145,7 @@ FileDescriptor::CreatePipeNonBlock(FileDescriptor &r, { int fds[2]; -#ifdef HAVE_PIPE2 +#ifdef __linux__ const int flags = O_CLOEXEC|O_NONBLOCK; const int result = pipe2(fds, flags); #else @@ -158,7 +158,7 @@ FileDescriptor::CreatePipeNonBlock(FileDescriptor &r, r = FileDescriptor(fds[0]); w = FileDescriptor(fds[1]); -#ifndef HAVE_PIPE2 +#ifndef __linux__ r.SetNonBlocking(); w.SetNonBlocking(); #endif |