From 7a6ee6fa119a79c7b3d199c9a3c2014c43930bdf Mon Sep 17 00:00:00 2001 From: emeric Date: Tue, 27 Apr 2021 08:52:41 +0200 Subject: [PATCH] Supress warning. ref #144 --- src/libs/utils/impl/ChildProcess.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libs/utils/impl/ChildProcess.cpp b/src/libs/utils/impl/ChildProcess.cpp index e45c0210..ae0ae91b 100644 --- a/src/libs/utils/impl/ChildProcess.cpp +++ b/src/libs/utils/impl/ChildProcess.cpp @@ -69,9 +69,10 @@ ChildProcess::ChildProcess(boost::asio::io_context& ioContext, const std::filesy throw SystemException {errno, "pipe2 failed!"}; { - const std::size_t pipeSize {65536*8}; - #if defined(__linux__) && defined(F_SETPIPE_SZ) + // Just a hint here to prevent the writer from writing too many bytes ahead of the reader + constexpr std::size_t pipeSize {65536*4}; + if (fcntl(pipe[0], F_SETPIPE_SZ, pipeSize) == -1) throw SystemException {errno, "fcntl failed!"}; if (fcntl(pipe[1], F_SETPIPE_SZ, pipeSize) == -1)