1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 12:41:15 +02:00

PosixSourceAccessor: Cache lstat() calls

Since we're doing a lot of them in assertNoSymlinks().
This commit is contained in:
Eelco Dolstra 2023-12-06 13:55:07 +01:00
parent 504e4fc457
commit 57246c4c38
2 changed files with 42 additions and 18 deletions

View file

@ -30,10 +30,14 @@ struct PosixSourceAccessor : virtual SourceAccessor
std::optional<CanonPath> getPhysicalPath(const CanonPath & path) override;
private:
/**
* Throw an error if `path` or any of its ancestors are symlinks.
*/
void assertNoSymlinks(CanonPath path);
std::optional<struct stat> cachedLstat(const CanonPath & path);
};
}