On 02/01/2023 13:28, Andreas Schwab wrote: > On Jan 02 2023, Pádraig Brady wrote: > >> + /* Note error set is consistent with copy_file_range(). */ >> + bool no_clone_attempted = errno == ENOSYS || is_ENOTSUP (errno) >> + || errno == EINVAL || errno == EBADF >> + || errno == EXDEV || errno == ETXTBSY; > > Should this be refactored to avoid duplication? Yes good call. We should also refactor the handling of clone failure to also apply to the usage of fclonefileat() on macOS. Updated patch attached. cheers, Pádraig