From ec18b17736a6e0ce98994daf5a6576e9658e4a1d Mon Sep 17 00:00:00 2001 From: Brian Aker Date: Mon, 9 Apr 2012 11:05:59 -0700 Subject: [PATCH] Update for compiling on OSX. --- configure.ac | 1 + libtest/cmdline.cc | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index d24d519f..de2bc881 100644 --- a/configure.ac +++ b/configure.ac @@ -107,6 +107,7 @@ AC_CHECK_FUNCS([gettimeofday]) AC_CHECK_FUNCS([memchr]) AC_CHECK_FUNCS([memmove]) AC_CHECK_FUNCS([memset]) +AC_CHECK_FUNCS([pipe2]) AC_CHECK_FUNCS([select]) AC_CHECK_FUNCS([setenv]) AC_CHECK_FUNCS([socket]) diff --git a/libtest/cmdline.cc b/libtest/cmdline.cc index 6fc34031..de7c89d7 100644 --- a/libtest/cmdline.cc +++ b/libtest/cmdline.cc @@ -36,6 +36,11 @@ using namespace libtest; #include #include #include +#include + +#ifndef __USE_GNU +static char **environ= NULL; +#endif extern "C" { static int exited_successfully(int status) @@ -533,7 +538,7 @@ void Application::Pipe::reset() close(READ); close(WRITE); -#if _GNU_SOURCE +#if HAVE_PIPE2 if (pipe2(_pipe_fd, O_NONBLOCK) == -1) #else if (pipe(_pipe_fd) == -1) -- 2.30.2