Use CopyFileRange from golang.org/x/sys/unix
Use the CopyFileRange and Lsetxattr from golang.org/x/sys/unix instead of their counterparts from github.com/containerd/continuity/sysx. These are 1:1 replacements (except for the fd parameter types in CopyFileRange). This will eventually allow to remove these functions there as well. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
This commit is contained in:
parent
4a6a2b9db0
commit
f2bed8ffb9
@ -37,7 +37,7 @@ func copyFileContent(dst, src *os.File) error {
|
||||
return errors.Wrap(err, "unable to stat source")
|
||||
}
|
||||
|
||||
n, err := sysx.CopyFileRange(src.Fd(), nil, dst.Fd(), nil, int(st.Size()), 0)
|
||||
n, err := unix.CopyFileRange(int(src.Fd()), nil, int(dst.Fd()), nil, int(st.Size()), 0)
|
||||
if err != nil {
|
||||
if err != unix.ENOSYS && err != unix.EXDEV {
|
||||
return errors.Wrap(err, "copy file range failed")
|
||||
|
Loading…
Reference in New Issue
Block a user