1
0
mirror of https://github.com/anope/anope.git synced 2026-07-04 01:23:12 +02:00

Use pipe() instead of pipe2() - some systems dont have pipe2()

This commit is contained in:
Adam
2010-08-22 12:23:43 -04:00
parent ada65a3baf
commit f20512c849
+5 -1
View File
@@ -16,8 +16,12 @@ int Pipe::SendInternal(const Anope::string &) const
Pipe::Pipe() : Socket()
{
int fds[2];
if (pipe2(fds, O_NONBLOCK))
if (pipe(fds))
throw CoreException(Anope::string("Could not create pipe: ") + strerror(errno));
int flags = fcntl(fds[0], F_GETFL, 0);
fcntl(fds[0], F_SETFL, flags | O_NONBLOCK);
flags = fcntl(fds[1], F_GETFL, 0);
fcntl(fds[1], F_SETFL, flags | O_NONBLOCK);
this->Sock = fds[0];
this->WritePipe = fds[1];