diff options
| author | наб <nabijaczleweli@nabijaczleweli.xyz> | 2025-01-23 20:55:28 +0100 |
|---|---|---|
| committer | Julian Andres Klode <julian.klode@canonical.com> | 2025-02-14 19:45:12 +0100 |
| commit | e3ec59bc982ca9dfb6bf6a322ec4abac907eb152 (patch) | |
| tree | cf159fa62e31a8af3d72f7f7878dd481814d9625 /apt-pkg | |
| parent | 30c3929e82c6894ff0460060c133f852b508965c (diff) | |
Take const& in GetLock()
Diffstat (limited to 'apt-pkg')
| -rw-r--r-- | apt-pkg/contrib/fileutl.cc | 2 | ||||
| -rw-r--r-- | apt-pkg/contrib/fileutl.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index 4f6eecf8b..76435bec8 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -247,7 +247,7 @@ static std::string GetProcessName(int pid) } return ""; } -int GetLock(string File,bool Errors) +int GetLock(string const &File,bool Errors) { // GetLock() is used in aptitude on directories with public-write access // Use O_NOFOLLOW here to prevent symlink traversal attacks diff --git a/apt-pkg/contrib/fileutl.h b/apt-pkg/contrib/fileutl.h index 9306842d1..1f31447dc 100644 --- a/apt-pkg/contrib/fileutl.h +++ b/apt-pkg/contrib/fileutl.h @@ -181,7 +181,7 @@ APT_PUBLIC bool RunScripts(const char *Cnf); APT_PUBLIC bool CopyFile(FileFd &From,FileFd &To); APT_PUBLIC bool RemoveFile(char const * const Function, std::string const &FileName); APT_PUBLIC bool RemoveFileAt(char const * const Function, int const dirfd, std::string const &FileName); -APT_PUBLIC int GetLock(std::string File,bool Errors = true); +APT_PUBLIC int GetLock(std::string const &File,bool Errors = true); APT_PUBLIC bool FileExists(std::string const &File); APT_PUBLIC bool RealFileExists(std::string const &File); APT_PUBLIC bool DirectoryExists(std::string const &Path); |
