From 800750c41514e6bbbd5637e89211f3de8c72ba55 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 13 Feb 2013 07:48:08 +0100 Subject: [PATCH] Build fix. --- lib/base/process.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/base/process.cpp b/lib/base/process.cpp index 4e60961b2..8c1aa0239 100644 --- a/lib/base/process.cpp +++ b/lib/base/process.cpp @@ -318,11 +318,18 @@ void Process::InitTask(void) #ifndef HAVE_PIPE2 int flags; - flags = fcntl(childTaskFd, F_GETFL, 0); + flags = fcntl(fds[0], F_GETFL, 0); if (flags < 0) BOOST_THROW_EXCEPTION(PosixException("fcntl failed", errno)); - if (fcntl(childTaskFd, F_SETFL, flags | O_NONBLOCK | O_CLOEXEC) < 0) + if (fcntl(fds[0], F_SETFL, flags | O_NONBLOCK | O_CLOEXEC) < 0) + BOOST_THROW_EXCEPTION(PosixException("fcntl failed", errno)); + + flags = fcntl(fds[1], F_GETFL, 0); + if (flags < 0) + BOOST_THROW_EXCEPTION(PosixException("fcntl failed", errno)); + + if (fcntl(fds[1], F_SETFL, flags | O_NONBLOCK | O_CLOEXEC) < 0) BOOST_THROW_EXCEPTION(PosixException("fcntl failed", errno)); #endif /* HAVE_PIPE2 */