From 04a99deb0ee2202224bfb5cab699b54e2b4e66d8 Mon Sep 17 00:00:00 2001 From: Chen Yufei Date: Wed, 24 Jan 2024 10:24:54 +0800 Subject: [PATCH] copy_file: ioctl_ficlone EACCES, EPERM as not supported. (#8425) ioctl_ficlone may return EPERM (in LXC container), EACCESS (in Android). Those error should be taken as ficlone being not supported instead of error. Refer to this coreutils bug report https://bugs.gnu.org/62404 --- src/copy_file.zig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/copy_file.zig b/src/copy_file.zig index 559a3fadc6..efbffdbc48 100644 --- a/src/copy_file.zig +++ b/src/copy_file.zig @@ -52,10 +52,9 @@ pub fn copyFile(in: InputType, out: InputType) CopyFileError!void { .NOMEM => return error.OutOfMemory, .NOSPC => return error.NoSpaceLeft, .OVERFLOW => return error.Unseekable, - .PERM => return error.PermissionDenied, .TXTBSY => return error.FileBusy, .XDEV => {}, - .BADF, .INVAL, .OPNOTSUPP, .NOSYS => { + .ACCES, .BADF, .INVAL, .OPNOTSUPP, .NOSYS, .PERM => { bun.Output.debug("ioctl_ficlonerange is NOT supported", .{}); can_use_ioctl_ficlone_.store(-1, .Monotonic); },