Build fix.

This commit is contained in:
Gunnar Beutner 2013-02-13 07:48:08 +01:00
parent b0d8c40d20
commit 800750c415
1 changed files with 9 additions and 2 deletions

View File

@ -318,11 +318,18 @@ void Process::InitTask(void)
#ifndef HAVE_PIPE2 #ifndef HAVE_PIPE2
int flags; int flags;
flags = fcntl(childTaskFd, F_GETFL, 0); flags = fcntl(fds[0], F_GETFL, 0);
if (flags < 0) if (flags < 0)
BOOST_THROW_EXCEPTION(PosixException("fcntl failed", errno)); 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)); BOOST_THROW_EXCEPTION(PosixException("fcntl failed", errno));
#endif /* HAVE_PIPE2 */ #endif /* HAVE_PIPE2 */