@@ -29,7 +29,9 @@ func copyRangeCopyFileRange(src, dst basicFile, srcOffset, dstOffset, size int64
|
||||
// appropriately.
|
||||
//
|
||||
// Also, even if explicitly not stated, the same is true for dstOffset
|
||||
n, err := unix.CopyFileRange(int(src.Fd()), &srcOffset, int(dst.Fd()), &dstOffset, int(size), 0)
|
||||
n, err := withFileDescriptors(src, dst, func(srcFd, dstFd uintptr) (int, error) {
|
||||
return unix.CopyFileRange(int(srcFd), &srcOffset, int(dstFd), &dstOffset, int(size), 0)
|
||||
})
|
||||
if n == 0 && err == nil {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user