commit 403c42204182515d7281d8c11084eef596f8a6ee from: Omar Polo date: Sat Oct 02 17:20:56 2021 UTC [cgi] switch from pipe(2) to socketpair(2) We can't use normal pipe(2)s with libevent in some cases. Switch to socketpair(2), which doesn't have the same problem. This has the drawback that it doesn't prevent the CGI script from reading stdout, for instance. (sockets are two-way, pipes only one-way) commit - b618111a681d278d0d72fbdb526542bebf8fce02 commit + 403c42204182515d7281d8c11084eef596f8a6ee blob - 102d5a214aec6a6e01992dbcb51001e1291ce0f7 blob + 59943d75405ccea4ffd8ce6ece65376ae1fb2bbb --- ex.c +++ ex.c @@ -130,9 +130,9 @@ launch_cgi(struct iri *iri, struct cgireq *req, struct { int p[2], errp[2]; /* read end, write end */ - if (pipe(p) == -1) + if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, p) == -1) return -1; - if (pipe(errp) == -1) + if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, errp) == -1) return -1; switch (fork()) {