Merge pull request #51 from indrekj/yosemite
Fix compiling on OS X Yosemite
This commit is contained in:
commit
1681fd6072
10
src/pipe.h
10
src/pipe.h
|
|
@ -42,8 +42,16 @@ public:
|
||||||
Pipe()
|
Pipe()
|
||||||
{
|
{
|
||||||
// construct the pipe
|
// construct the pipe
|
||||||
|
#ifdef _GNU_SOURCE
|
||||||
if (pipe2(_fds, O_CLOEXEC) == 0) return;
|
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
|
// something went wrong
|
||||||
throw std::runtime_error(strerror(errno));
|
throw std::runtime_error(strerror(errno));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@
|
||||||
* Dependencies
|
* Dependencies
|
||||||
*/
|
*/
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
|
#include <sys/uio.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set up namespace
|
* Set up namespace
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue