From 737f664604b28f230be63bfc2f3d516fd9eb1c63 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 26 Aug 2008 14:06:42 +1000 Subject: [PATCH] EINVAL is also a valid error return, meaning "this filesystem cannot do sendfile for this file" --- source/smbd/reply.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/smbd/reply.c b/source/smbd/reply.c index b3d691fbe7e..06aa835cb0e 100644 --- a/source/smbd/reply.c +++ b/source/smbd/reply.c @@ -3198,8 +3198,9 @@ static void send_file_readX(connection_struct *conn, struct smb_request *req, setup_readX_header((char *)headerbuf, smb_maxcnt); if ((nread = SMB_VFS_SENDFILE(smbd_server_fd(), fsp, &header, startpos, smb_maxcnt)) == -1) { - /* Returning ENOSYS means no data at all was sent. Do this as a normal read. */ - if (errno == ENOSYS) { + /* Returning ENOSYS or EINVAL means no data at all was sent. + Do this as a normal read. */ + if (errno == ENOSYS || errno == EINVAL) { goto normal_read; } -- 2.34.1