From 795baed3f5c56a9a05c046b7ddd6d93eba39a560 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 20 Aug 2018 17:04:43 +0200 Subject: system/FileDescriptor: make pipe2() mandatory on Linux --- src/system/FileDescriptor.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') 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 -- cgit v1.2.3