summaryrefslogtreecommitdiff
path: root/lib/backupstore
diff options
context:
space:
mode:
Diffstat (limited to 'lib/backupstore')
-rw-r--r--lib/backupstore/BackupProtocol.h2
-rw-r--r--lib/backupstore/BackupStoreContext.cpp8
-rw-r--r--lib/backupstore/BackupStoreContext.h5
3 files changed, 8 insertions, 7 deletions
diff --git a/lib/backupstore/BackupProtocol.h b/lib/backupstore/BackupProtocol.h
index d2fe8b7f..8736b44f 100644
--- a/lib/backupstore/BackupProtocol.h
+++ b/lib/backupstore/BackupProtocol.h
@@ -35,7 +35,7 @@ public:
// This is rather ugly: the BackupProtocolLocal constructor must not
// touch the Context, because it's not initialised yet!
: BackupProtocolLocal(mContext),
- mContext(AccountNumber, *(HousekeepingInterface *)NULL,
+ mContext(AccountNumber, (HousekeepingInterface *)NULL,
ConnectionDetails)
{
mContext.SetClientHasAccount(AccountRootDir, DiscSetNumber);
diff --git a/lib/backupstore/BackupStoreContext.cpp b/lib/backupstore/BackupStoreContext.cpp
index 155abd7f..771bc960 100644
--- a/lib/backupstore/BackupStoreContext.cpp
+++ b/lib/backupstore/BackupStoreContext.cpp
@@ -54,10 +54,10 @@
//
// --------------------------------------------------------------------------
BackupStoreContext::BackupStoreContext(int32_t ClientID,
- HousekeepingInterface &rDaemon, const std::string& rConnectionDetails)
+ HousekeepingInterface* pHousekeeping, const std::string& rConnectionDetails)
: mConnectionDetails(rConnectionDetails),
mClientID(ClientID),
- mrDaemon(rDaemon),
+ mpHousekeeping(pHousekeeping),
mProtocolPhase(Phase_START),
mClientHasAccount(false),
mStoreDiscSet(-1),
@@ -160,13 +160,13 @@ bool BackupStoreContext::AttemptToGetWriteLock()
// Request the lock
bool gotLock = mWriteLock.TryAndGetLock(writeLockFile.c_str(), 0600 /* restrictive file permissions */);
- if(!gotLock)
+ if(!gotLock && mpHousekeeping)
{
// The housekeeping process might have the thing open -- ask it to stop
char msg[256];
int msgLen = sprintf(msg, "r%x\n", mClientID);
// Send message
- mrDaemon.SendMessageToHousekeepingProcess(msg, msgLen);
+ mpHousekeeping->SendMessageToHousekeepingProcess(msg, msgLen);
// Then try again a few times
int tries = MAX_WAIT_FOR_HOUSEKEEPING_TO_RELEASE_ACCOUNT;
diff --git a/lib/backupstore/BackupStoreContext.h b/lib/backupstore/BackupStoreContext.h
index 9dde2075..e0162636 100644
--- a/lib/backupstore/BackupStoreContext.h
+++ b/lib/backupstore/BackupStoreContext.h
@@ -45,7 +45,8 @@ class HousekeepingInterface
class BackupStoreContext
{
public:
- BackupStoreContext(int32_t ClientID, HousekeepingInterface &rDaemon,
+ BackupStoreContext(int32_t ClientID,
+ HousekeepingInterface* mpHousekeeping,
const std::string& rConnectionDetails);
~BackupStoreContext();
private:
@@ -173,7 +174,7 @@ private:
std::string mConnectionDetails;
int32_t mClientID;
- HousekeepingInterface &mrDaemon;
+ HousekeepingInterface *mpHousekeeping;
int mProtocolPhase;
bool mClientHasAccount;
std::string mAccountRootDir; // has final directory separator