Add a debug message for cases where sendfile() fails

This commit is contained in:
nick
2013-02-06 14:41:49 +00:00
parent 184a13bc9f
commit 56ce7d35c2

View File

@@ -148,7 +148,10 @@ int sendfileloop(int out_fd, int in_fd, off64_t *offset, size_t count)
ssize_t result = sendfile64(out_fd, in_fd, offset, count-sent);
debug("sendfile64(out_fd=%d, in_fd=%d, offset=%p, count-sent=%ld) = %ld", out_fd, in_fd, offset, count-sent, result);
if (result == -1) { return -1; }
if (result == -1) {
debug( "%s (%i) calling sendfile64()", strerror(errno), errno );
return -1;
}
sent += result;
debug("sent=%ld, count=%ld", sent, count);
}