xsplice: return -1 on error - geomyidae - A small C-based gopherd.
HTML git clone git://bitreich.org/geomyidae/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/geomyidae/
DIR Log
DIR Files
DIR Refs
DIR Tags
DIR README
DIR LICENSE
---
DIR commit fc79d9a4d2cd906e09d9f046e9f1cc91e35b0f7e
DIR parent 2ea7fc9967866e29f459515cbac7e03ce10e23a4
HTML Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Fri, 31 Mar 2023 20:22:25 +0200
xsplice: return -1 on error
Signed-off-by: Christoph Lohmann <20h@r-36.net>
Diffstat:
M ind.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
DIR diff --git a/ind.c b/ind.c
@@ -116,14 +116,14 @@ xsplice(int fd, int sock)
BLOCK_SIZE, SPLICE_F_MOVE | SPLICE_F_MORE);
if (nread <= 0) {
- ret = nread < 0 ? 1 : 0;
+ ret = nread < 0 ? -1 : 0;
goto out;
}
nwritten = splice(pipefd[0], NULL, sock, NULL, BLOCK_SIZE,
SPLICE_F_MOVE | SPLICE_F_MORE);
if (nwritten < 0) {
- ret = 1;
+ ret = -1;
goto out;
}
} while (nwritten > 0);