static ssize_t tsmsm_sendfile(vfs_handle_struct *handle, int tofd, files_struct *fsp, const DATA_BLOB *hdr,
SMB_OFF_T offset, size_t n)
{
- bool file_online = tsmsm_aio_force(handle, fsp);
+ bool file_offline = tsmsm_aio_force(handle, fsp);
- if(!file_online)
- return ENOSYS;
+ if (file_offline) {
+ DEBUG(10,("tsmsm_sendfile on offline file - rejecting\n"));
+ errno = ENOSYS;
+ return -1;
+ }
return SMB_VFS_NEXT_SENDFILE(handle, tofd, fsp, hdr, offset, n);
}
if (tsmd->hsmscript == NULL) {
/* no script enabled */
- DEBUG(1, ("tsmsm_set_offline: No tsmsm:hsmscript configured\n"));
+ DEBUG(1, ("tsmsm_set_offline: No 'tsmsm:hsm script' configured\n"));
return 0;
}