Updated logging output during readloop() and writeloop() failures

There's a handy SHOW_ERRNO macro we can use to get consistent logging
for system call failures from readloop() and writeloop().
This commit is contained in:
Patrick J Cherry
2018-04-27 10:07:48 +01:00
parent 3e0d30f6b9
commit 102738d9ad
3 changed files with 30 additions and 30 deletions

View File

@@ -148,8 +148,6 @@ int readloop(int filedes, void *buffer, size_t size)
ssize_t result = read(filedes, buffer + readden, size - readden);
if (result == 0 /* EOF */ ) {
warn("end-of-file detected while reading after %i bytes",
readden);
return -1;
}
@@ -224,9 +222,8 @@ int splice_via_pipe_loop(int fd_in, int fd_out, size_t len)
while (spliced < len) {
ssize_t run = len - spliced;
ssize_t s2, s1 =
spliceloop(fd_in, NULL, pipefd[1], NULL, run,
SPLICE_F_NONBLOCK);
ssize_t s2, s1 = spliceloop(fd_in, NULL, pipefd[1], NULL, run,
SPLICE_F_NONBLOCK);
/*if (run > 65535)
run = 65535; */
if (s1 < 0) {