]> 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)
committerGitHub <noreply@github.com>
Wed, 1 Oct 2025 18:31:16 +0000 (20:31 +0200)
This fixes a compilation error with tl::expected ≥ 1.2.0 on non-Apple platforms where sendfile(2) is not available.

src/ccache/util/file.cpp

index fe724517697e77daef58a34e7cf8991b38e4e38c..686a7028dc5aebd9cfe1300f4da492d27f91ffe2 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