From: Brian Aker Date: Fri, 19 Apr 2013 00:41:26 +0000 (-0700) Subject: OSX fix for test system. X-Git-Tag: 1.0.18~29^2~2 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=6d0a8ff888dcb162d5a3aee423f0b05e4f112cc0;p=awesomized%2Flibmemcached OSX fix for test system. --- 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()