mirror of
https://github.com/omar-polo/gmid.git
synced 2024-09-28 21:41:56 +02:00
[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)
This commit is contained in:
parent
b618111a68
commit
403c422041
4
ex.c
4
ex.c
@ -130,9 +130,9 @@ launch_cgi(struct iri *iri, struct cgireq *req, struct vhost *vhost,
|
||||
{
|
||||
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()) {
|
||||
|
Loading…
Reference in New Issue
Block a user