Skip to content

Commit

Permalink
Fall back to Copyfile when Clonefile detects a cross-device request
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Dubois <jan.dubois@suse.com>
  • Loading branch information
jandubois committed May 20, 2023
1 parent 21eb927 commit 7df79f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/copy_darwin.go
Expand Up @@ -25,7 +25,7 @@ import (

func copyFile(target, source string) error {
if err := unix.Clonefile(source, target, unix.CLONE_NOFOLLOW); err != nil {
if !errors.Is(err, unix.ENOTSUP) {
if !errors.Is(err, unix.ENOTSUP) && !errors.Is(err, unix.EXDEV) {
return fmt.Errorf("clonefile failed: %w", err)
}

Expand Down

0 comments on commit 7df79f5

Please sign in to comment.