From 6d0a8ff888dcb162d5a3aee423f0b05e4f112cc0 Mon Sep 17 00:00:00 2001 From: Brian Aker Date: Thu, 18 Apr 2013 17:41:26 -0700 Subject: [PATCH] OSX fix for test system. --- libtest/cmdline.cc | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/libtest/cmdline.cc b/libtest/cmdline.cc index a6374060..0553fdde 100644 --- a/libtest/cmdline.cc +++ b/libtest/cmdline.cc @@ -604,23 +604,21 @@ void Application::Pipe::reset() close(READ); close(WRITE); -#if defined(HAVE_PIPE2) && HAVE_PIPE2 +#ifdef HAVE_PIPE2 if (pipe2(_pipe_fd, O_NONBLOCK|O_CLOEXEC) == -1) -#else - if (pipe(_pipe_fd) == -1) #endif { - FATAL(strerror(errno)); - } - _open[0]= true; - _open[1]= true; + if (pipe(_pipe_fd) == -1) + { + FATAL(strerror(errno)); + } -#if defined(HAVE_PIPE2) && HAVE_PIPE2 - { + // Since either pipe2() was not found/called we set the pipe directly nonblock(); cloexec(); } -#endif + _open[0]= true; + _open[1]= true; } void Application::Pipe::cloexec() -- 2.30.2