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:
parent
504e4fc457
commit
57246c4c38
2 changed files with 42 additions and 18 deletions
|
@ -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);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue