]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
fix: Add missing return in copy_file_impl fallback code (#1630)
authorkingiler <68145845+kingiler@users.noreply.github.com>
Wed, 1 Oct 2025 18:31:16 +0000 (19:31 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Wed, 1 Oct 2025 18:32:04 +0000 (20:32 +0200)
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

index d8f1cb55e36d8abba332c4f188d1dc16de65b6d2..c4ea997b6363611684588c6403665999b7369ecc 100644 (file)
@@ -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