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-Tag: v4.12.1~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d3604fea44cad659aadac3676dc063db687eb562;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. (cherry picked from commit 50ad20d7fa2db903ce45c9ba426ac5f694fb752b) --- diff --git a/src/ccache/util/file.cpp b/src/ccache/util/file.cpp index d8f1cb55..c4ea997b 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