WIP
[m6w6/libmemcached] / test / lib / ForkAndExec.cpp
index 48a8dc18bac36621cedfd50d7ef5f1ae9ae7df66..753e06ee88f680104886cc9cc1140f5e9324ef72 100644 (file)
@@ -4,7 +4,10 @@
 
 #include <fcntl.h>
 #include <sys/poll.h>
-#include <unistd.h>
+#if HAVE_UNISTD_H
+#  include <unistd.h>
+#endif
+#include <spawn.h>
 
 #if !HAVE_PIPE2
 static inline int setfl(int fd, int newflags) {
@@ -107,7 +110,7 @@ void ForkAndExec::closePipe(int &fd) {
 }
 
 void ForkAndExec::pollExecReadyPipe() {
-#if __APPLE__ || __FreeBSD__
+#if __APPLE__
   char c, n = 50;
   do {
     if (0 == read(ready[mode::READ], &c, 1)) {