]> git.ipfire.org Git - thirdparty/pdns.git/blobdiff - pdns/recursordist/test-negcache_cc.cc
rec: Switch to `pdns::UniqueFilePtr`
[thirdparty/pdns.git] / pdns / recursordist / test-negcache_cc.cc
index f6ce64c4a60b32f3a2eddade9e03552ebf879620..44834b631512b38ca44e7928b09c6654af76d78f 100644 (file)
@@ -525,9 +525,10 @@ BOOST_AUTO_TEST_CASE(test_dumpToFile)
   cache.add(genNegCacheEntry(DNSName("www1.powerdns.com"), DNSName("powerdns.com"), now));
   cache.add(genNegCacheEntry(DNSName("www2.powerdns.com"), DNSName("powerdns.com"), now));
 
-  auto fp = std::unique_ptr<FILE, int (*)(FILE*)>(tmpfile(), fclose);
-  if (!fp)
+  auto fp = pdns::UniqueFilePtr(tmpfile());
+  if (!fp) {
     BOOST_FAIL("Temporary file could not be opened");
+  }
 
   cache.doDump(fileno(fp.get()), 0, now.tv_sec);