mirror of https://github.com/omar-polo/gmid.git
ensure CGI stdout it's blocking
This commit is contained in:
parent
19e7bd00a3
commit
52053e1a61
3
ex.c
3
ex.c
|
@ -238,7 +238,7 @@ launch_cgi(struct iri *iri, const char *spath, char *relpath,
|
||||||
{
|
{
|
||||||
int p[2]; /* read end, write end */
|
int p[2]; /* read end, write end */
|
||||||
|
|
||||||
if (pipe2(p, O_NONBLOCK) == -1)
|
if (pipe(p) == -1)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
switch (fork()) {
|
switch (fork()) {
|
||||||
|
@ -321,6 +321,7 @@ launch_cgi(struct iri *iri, const char *spath, char *relpath,
|
||||||
|
|
||||||
default:
|
default:
|
||||||
close(p[1]);
|
close(p[1]);
|
||||||
|
mark_nonblock(p[0]);
|
||||||
return p[0];
|
return p[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue