aboutsummaryrefslogtreecommitdiff
path: root/ex.c
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2021-02-06 09:56:34 +0000
committerOmar Polo <op@omarpolo.com>2021-02-06 09:56:34 +0000
commit52053e1a61dcf07752f449f8f430855004d4037b (patch)
tree7a87afe3e07e717f284a5a9ed9b99ddbff1916ef /ex.c
parent19e7bd00a3d1b2574e3ed149fa354d45e83a8b50 (diff)
ensure CGI stdout it's blocking
Diffstat (limited to 'ex.c')
-rw-r--r--ex.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ex.c b/ex.c
index 1be5891..d6bcabf 100644
--- a/ex.c
+++ b/ex.c
@@ -238,7 +238,7 @@ launch_cgi(struct iri *iri, const char *spath, char *relpath,
{
int p[2]; /* read end, write end */
- if (pipe2(p, O_NONBLOCK) == -1)
+ if (pipe(p) == -1)
return -1;
switch (fork()) {
@@ -321,6 +321,7 @@ launch_cgi(struct iri *iri, const char *spath, char *relpath,
default:
close(p[1]);
+ mark_nonblock(p[0]);
return p[0];
}