commit b8f2f9e71128445ed61141bb7eec1d241790fb43
parent c0cf9ade2605856d2aac986e5bfb429badc5c729
Author: Christoph Lohmann <20h@r-36.net>
Date: Mon, 1 Aug 2022 13:45:52 +0200
Do not exit in splice when pipe is unsuccessfull.
Diffstat:
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/ind.c b/ind.c
@@ -108,10 +108,8 @@ xsplice(int fd, int sock)
ssize_t nread, nwritten;
off_t in_offset = 0;
- if (pipe(pipefd) < 0) {
- perror("pipe");
- exit(1);
- }
+ if (pipe(pipefd) < 0)
+ return -1;
do {
nread = splice(fd, &in_offset, pipefd[1], NULL,