From d3604fea44cad659aadac3676dc063db687eb562 Mon Sep 17 00:00:00 2001 From: kingiler <68145845+kingiler@users.noreply.github.com> Date: Wed, 1 Oct 2025 19:31:16 +0100 Subject: [PATCH] fix: Add missing return in copy_file_impl fallback code (#1630) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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) --- src/ccache/util/file.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 -- 2.47.3