From: Andrew Tridgell Date: Tue, 26 Aug 2008 04:06:42 +0000 (+1000) Subject: EINVAL is also a valid error return, meaning "this filesystem X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=737f664604b28f230be63bfc2f3d516fd9eb1c63;p=thirdparty%2Fsamba.git EINVAL is also a valid error return, meaning "this filesystem cannot do sendfile for this file" --- 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; }