OSX fix for test system.
authorBrian Aker <brian@tangent.org>
Fri, 19 Apr 2013 00:41:26 +0000 (17:41 -0700)
committerBrian Aker <brian@tangent.org>
Fri, 19 Apr 2013 00:41:26 +0000 (17:41 -0700)
libtest/cmdline.cc

index a63740607b3f0e1f02a3e2f23d98ac59f82d043f..0553fddebb2172f229e4d5e96fb0066d69a0688e 100644 (file)
@@ -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()