1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

EINVAL is also a valid error return, meaning "this filesystem

cannot do sendfile for this file"
This commit is contained in:
Andrew Tridgell 2008-08-26 14:06:42 +10:00 committed by Michael Adam
parent c548e5c69f
commit 737f664604

View File

@ -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;
}