libstore: make BinaryCacheStore::getFile return a source
this lets us remove the last true remaining uses of makeDecompressionSink. Change-Id: I146ca2bbe1a9ae9a367117a7b8a304b23a63e5e2
This commit is contained in:
@@ -294,7 +294,9 @@ Generator<Bytes> 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<Bytes> {
|
||||
co_yield drainFDSource(fd.get());
|
||||
}(std::move(fd));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user