Handle EINTR while dup2() in handlecgi(). - geomyidae - A small C-based gopherd. | |
git clone git://bitreich.org/geomyidae/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/geomyidae/ | |
Log | |
Files | |
Refs | |
Tags | |
README | |
LICENSE | |
--- | |
commit 6dc65c6ce9c4a41c034aa1f21d9ff2a1573efde4 | |
parent 73b1a17ecfe53540e39ca60059235ce91c70c932 | |
Author: Christoph Lohmann <20h@r-36.net> | |
Date: Sat, 22 Jul 2023 17:17:35 +0200 Handle EINTR while dup2() in handlecgi(). Diffstat: M handlr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- | |
diff --git a/handlr.c b/handlr.c | |
@@ -167,9 +167,9 @@ handlecgi(int sock, char *file, char *port, char *base, char *args, if (args == NULL) args = ""; - dup2(sock, 0); - dup2(sock, 1); - dup2(sock, 2); + while (dup2(sock, 0) < 0 && errno == EINTR); + while (dup2(sock, 1) < 0 && errno == EINTR); + while (dup2(sock, 2) < 0 && errno == EINTR); switch (fork()) { case 0: if (path != NULL) { |