From 5587dbdcf078586dcc5b9c54af614c1915e9da0a Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Sat, 11 May 2024 00:22:21 +0200 Subject: libstore: make BinaryCacheStore::getFile return a source this lets us remove the last true remaining uses of makeDecompressionSink. Change-Id: I146ca2bbe1a9ae9a367117a7b8a304b23a63e5e2 --- src/libutil/file-system.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/libutil/file-system.cc') diff --git a/src/libutil/file-system.cc b/src/libutil/file-system.cc index 13c2b27eb..278e5187c 100644 --- a/src/libutil/file-system.cc +++ b/src/libutil/file-system.cc @@ -294,7 +294,9 @@ Generator readFileSource(const Path & path) AutoCloseFD fd{open(path.c_str(), O_RDONLY | O_CLOEXEC)}; if (!fd) throw SysError("opening file '%s'", path); - co_yield drainFDSource(fd.get()); + return [](AutoCloseFD fd) -> Generator { + co_yield drainFDSource(fd.get()); + }(std::move(fd)); } -- cgit v1.2.3