From dce9bb8c205b208f638fcfa37561452869b24a67 Mon Sep 17 00:00:00 2001 From: christos <christos@cern.ch> Date: Wed, 12 May 2021 00:45:39 +0200 Subject: [PATCH] ATLASRECTS-5296 This should be the last usage of auto_ptr to be migrated to unique_ptr --- Database/APR/FileCatalog/utilities/FCdeleteLFN.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Database/APR/FileCatalog/utilities/FCdeleteLFN.cpp b/Database/APR/FileCatalog/utilities/FCdeleteLFN.cpp index 886067384b21..399350215ce6 100755 --- a/Database/APR/FileCatalog/utilities/FCdeleteLFN.cpp +++ b/Database/APR/FileCatalog/utilities/FCdeleteLFN.cpp @@ -25,7 +25,7 @@ static const char* opts[] = {"q","l","u","h",0}; int main(int argc, char** argv) { SystemTools::initGaudi(); - + std::string myuri; std::string mylfn; std::string myquery; @@ -37,7 +37,7 @@ int main(int argc, char** argv) myuri=commands.GetByName("u"); }else{ myuri=SystemTools::GetEnvStr("POOL_CATALOG"); - } + } if( commands.Exists("q") ){ myquery=commands.GetByName("q"); } @@ -52,14 +52,14 @@ int main(int argc, char** argv) std::cerr << "Error: command parsing error "<<strError<<std::endl; exit(0); } - + if( mylfn.empty() && myquery.empty() ){ printUsage(); std::cerr<<"Error: must specify pfname using -l, query using -q"<<std::endl; exit(0); } - try{ - std::auto_ptr<IFileCatalog> mycatalog(new IFileCatalog); + try{ + auto mycatalog = std::make_unique<IFileCatalog>(); pool::URIParser p( myuri ); p.parse(); mycatalog->setWriteCatalog(p.contactstring()); @@ -67,11 +67,11 @@ int main(int argc, char** argv) mycatalog->start(); if( !myquery.empty() ){ std::cerr << "Query option not supported" << std::endl; - exit(2); + exit(2); }else if( !mylfn.empty() ) { mycatalog->deleteLFN(mylfn); } - mycatalog->commit(); + mycatalog->commit(); mycatalog->disconnect(); }catch (const pool::Exception& er){ std::cerr<<er.what()<<std::endl; -- GitLab