From: kingiler <68145845+kingiler@users.noreply.github.com> Date: Wed, 1 Oct 2025 18:31:16 +0000 (+0100) Subject: fix: Add missing return in copy_file_impl fallback code (#1630) X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=50ad20d7fa2db903ce45c9ba426ac5f694fb752b;p=thirdparty%2Fccache.git fix: Add missing return in copy_file_impl fallback code (#1630) This fixes a compilation error with tl::expected ≥ 1.2.0 on non-Apple platforms where sendfile(2) is not available. --- diff --git a/src/ccache/util/file.cpp b/src/ccache/util/file.cpp index fe724517..686a7028 100644 --- a/src/ccache/util/file.cpp +++ b/src/ccache/util/file.cpp @@ -160,6 +160,7 @@ copy_file_impl(const fs::path& src, return tl::unexpected( FMT("Failed to copy {} to {}: {}", src, dest, strerror(errno))); } + return {}; # elif defined(HAVE_SYS_SENDFILE_H) DirEntry dir_entry(src, *src_fd); if (!dir_entry) { @@ -180,10 +181,10 @@ copy_file_impl(const fs::path& src, } bytes_left -= n; } + return {}; # else - copy_fd(*src_fd, *dst_fd); + return copy_fd(*src_fd, *dst_fd); # endif - return {}; } #endif