Merge pull request #51 from indrekj/yosemite

Fix compiling on OS X Yosemite
This commit is contained in:
Emiel Bruijntjes 2016-03-22 09:21:19 +01:00
commit 1681fd6072
2 changed files with 10 additions and 1 deletions

View File

@ -42,8 +42,16 @@ public:
Pipe()
{
// construct the pipe
#ifdef _GNU_SOURCE
if (pipe2(_fds, O_CLOEXEC) == 0) return;
#else
if (
pipe(_fds) == 0 &&
fcntl(_fds[0], F_SETFD, FD_CLOEXEC) == 0 &&
fcntl(_fds[1], F_SETFD, FD_CLOEXEC) == 0
) return;
#endif
// something went wrong
throw std::runtime_error(strerror(errno));
}

View File

@ -17,6 +17,7 @@
* Dependencies
*/
#include <sys/ioctl.h>
#include <sys/uio.h>
/**
* Set up namespace