aboutsummaryrefslogtreecommitdiff
path: root/crypto/openssl/include/internal/ktls.h
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/openssl/include/internal/ktls.h')
-rw-r--r--crypto/openssl/include/internal/ktls.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/crypto/openssl/include/internal/ktls.h b/crypto/openssl/include/internal/ktls.h
index 9032c0ed6174..622d7be76d1e 100644
--- a/crypto/openssl/include/internal/ktls.h
+++ b/crypto/openssl/include/internal/ktls.h
@@ -192,15 +192,12 @@ static ossl_inline int ktls_read_record(int fd, void *data, size_t length)
static ossl_inline ossl_ssize_t ktls_sendfile(int s, int fd, off_t off,
size_t size, int flags)
{
- off_t sbytes;
+ off_t sbytes = 0;
int ret;
ret = sendfile(fd, s, off, size, NULL, &sbytes, flags);
- if (ret == -1) {
- if (errno == EAGAIN && sbytes != 0)
- return sbytes;
- return -1;
- }
+ if (ret == -1 && sbytes == 0)
+ return -1;
return sbytes;
}