summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire-item.cc
diff options
context:
space:
mode:
authorнаб <nabijaczleweli@nabijaczleweli.xyz>2024-11-12 13:28:04 +0100
committerнаб <nabijaczleweli@nabijaczleweli.xyz>2024-11-12 13:46:06 +0100
commit78e503bc1d79bc4fc29bc9cbe1dfb68ae4d16acf (patch)
tree67beaeec79a01ea97785bc5ad1476f3c2315e107 /apt-pkg/acquire-item.cc
parentc87f3bdd1790bb75447c2ec8f95e5e07bdce58d5 (diff)
Turn unique_ptr<decltype(fclose and free)> into real deleter types (warnings now, UB in C++20)
Diffstat (limited to 'apt-pkg/acquire-item.cc')
-rw-r--r--apt-pkg/acquire-item.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index b534d56a3..3016dad59 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -4065,7 +4065,7 @@ static std::string GetAuxFileNameFromURIInLists(std::string const &uri)
auto const dirname = flCombine(_config->FindDir("Dir::State::lists"), "auxfiles/");
char const * const filetag = ".apt-acquire-privs-test.XXXXXX";
std::string const tmpfile_tpl = flCombine(dirname, filetag);
- std::unique_ptr<char, decltype(std::free) *> tmpfile { strdup(tmpfile_tpl.c_str()), std::free };
+ std::unique_ptr<char, FreeDeleter> tmpfile { strdup(tmpfile_tpl.c_str()) };
int const fd = mkstemp(tmpfile.get());
if (fd == -1)
return "";
@@ -4081,7 +4081,7 @@ static std::string GetAuxFileNameFromURI(std::string const &uri)
std::string tmpdir_tpl;
strprintf(tmpdir_tpl, "%s/apt-auxfiles-XXXXXX", GetTempDir().c_str());
- std::unique_ptr<char, decltype(std::free) *> tmpdir { strndup(tmpdir_tpl.data(), tmpdir_tpl.length()), std::free };
+ std::unique_ptr<char, FreeDeleter> tmpdir { strndup(tmpdir_tpl.data(), tmpdir_tpl.length()) };
if (mkdtemp(tmpdir.get()) == nullptr)
{
_error->Errno("GetAuxFileNameFromURI", "mkdtemp of %s failed", tmpdir.get());