summaryrefslogtreecommitdiff
path: root/bin/bbackupd/BackupDaemon.cpp
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2014-08-15 22:47:27 +0000
committerChris Wilson <chris+github@qwirx.com>2014-08-15 22:47:27 +0000
commit59b5045c4005dd85658de4f613237e21e897f6b2 (patch)
treea133d48298c03d5ab7baddc7d1fc308dc3ee1da8 /bin/bbackupd/BackupDaemon.cpp
parent84d41d846b44d94ec87105e92aa5a2513975dd2b (diff)
Use std::auto_ptrs instead of bare pointers for exclude lists.
Allows us to remove code to handle cleanups after exceptions and on Location destruction.
Diffstat (limited to 'bin/bbackupd/BackupDaemon.cpp')
-rw-r--r--bin/bbackupd/BackupDaemon.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/bin/bbackupd/BackupDaemon.cpp b/bin/bbackupd/BackupDaemon.cpp
index 3d352286..577b1861 100644
--- a/bin/bbackupd/BackupDaemon.cpp
+++ b/bin/bbackupd/BackupDaemon.cpp
@@ -1034,8 +1034,8 @@ void BackupDaemon::RunSyncNow()
// Set exclude lists (context doesn't
// take ownership)
clientContext.SetExcludeLists(
- (*i)->mpExcludeFiles,
- (*i)->mpExcludeDirs);
+ (*i)->mapExcludeFiles.get(),
+ (*i)->mapExcludeDirs.get());
// Sync the directory
std::string locationPath = (*i)->mPath;
@@ -1046,7 +1046,7 @@ void BackupDaemon::RunSyncNow()
}
#endif
- (*i)->mpDirectoryRecord->SyncDirectory(params,
+ (*i)->mapDirectoryRecord->SyncDirectory(params,
BackupProtocolListDirectory::RootDirectory,
locationPath, std::string("/") + (*i)->mName, **i);
@@ -2408,8 +2408,8 @@ void BackupDaemon::SetupLocations(BackupClientContext &rClientContext, const Con
pLoc->mPath = rConfig.GetKeyValue("Path");
// Read the exclude lists from the Configuration
- pLoc->mpExcludeFiles = BackupClientMakeExcludeList_Files(rConfig);
- pLoc->mpExcludeDirs = BackupClientMakeExcludeList_Dirs(rConfig);
+ pLoc->mapExcludeFiles.reset(BackupClientMakeExcludeList_Files(rConfig));
+ pLoc->mapExcludeDirs.reset(BackupClientMakeExcludeList_Dirs(rConfig));
}
// Does this exist on the server?
@@ -2558,11 +2558,10 @@ void BackupDaemon::SetupLocations(BackupClientContext &rClientContext, const Con
// Create and store the directory object for the root of this location
ASSERT(oid != 0);
- if(pLoc->mpDirectoryRecord.get() == NULL)
+ if(pLoc->mapDirectoryRecord.get() == NULL)
{
- BackupClientDirectoryRecord *precord =
- new BackupClientDirectoryRecord(oid, *pLocName);
- pLoc->mpDirectoryRecord.reset(precord);
+ pLoc->mapDirectoryRecord.reset(
+ new BackupClientDirectoryRecord(oid, *pLocName));
}
// Remove it from the temporary list to avoid deletion