diff --git a/io/copy.h b/io/copy.h index d8441fb..dba0ec2 100644 --- a/io/copy.h +++ b/io/copy.h @@ -114,7 +114,7 @@ template void CopyHelper::copy(NativeFileSt while (count) { const auto bytesCopied = ::sendfile64(output.fileDescriptor(), input.fileDescriptor(), nullptr, count); if (bytesCopied < 0) { - if (errno == EINVAL && static_cast(totalBytes) == count) { + if ((errno == EINVAL || errno == ENOSYS) && static_cast(totalBytes) == count) { // try again the unoptimized version, maybe the filesystem doesn't support sendfile goto unoptimized_version; } @@ -163,7 +163,7 @@ void CopyHelper::callbackCopy(NativeFileStream &input, NativeFileStr const auto bytesToCopy = static_cast(std::min(count, static_cast(bufferSize))); const auto bytesCopied = ::sendfile64(output.fileDescriptor(), input.fileDescriptor(), nullptr, bytesToCopy); if (bytesCopied < 0) { - if (errno == EINVAL && static_cast(totalBytes) == count) { + if ((errno == EINVAL || errno == ENOSYS) && static_cast(totalBytes) == count) { // try again the unoptimized version, maybe the filesystem doesn't support sendfile goto unoptimized_version; }