[Box Backup-commit] COMMIT r1069 - box/chris/general/bin/bbstored
boxbackup-dev@fluffy.co.uk
boxbackup-dev@fluffy.co.uk
Mon, 16 Oct 2006 00:05:51 +0100
Author: chris
Date: 2006-10-16 00:05:51 +0100 (Mon, 16 Oct 2006)
New Revision: 1069
Modified:
box/chris/general/bin/bbstored/BBStoreDHousekeeping.cpp
Log:
Don't write to the interprocess comms socket if it's not open.
Modified: box/chris/general/bin/bbstored/BBStoreDHousekeeping.cpp
===================================================================
--- box/chris/general/bin/bbstored/BBStoreDHousekeeping.cpp 2006-10-15 23:05:17 UTC (rev 1068)
+++ box/chris/general/bin/bbstored/BBStoreDHousekeeping.cpp 2006-10-15 23:05:51 UTC (rev 1069)
@@ -50,7 +50,8 @@
{
RunHousekeepingIfNeeded();
- // Calculate how long should wait before doing the next housekeeping run
+ // Calculate how long should wait before doing the next
+ // housekeeping run
int64_t timeNow = GetCurrentBoxTime();
time_t secondsToGo = BoxTimeToSeconds(
(mLastHousekeepingRun + housekeepingInterval) -
@@ -72,6 +73,7 @@
// Time now
int64_t timeNow = GetCurrentBoxTime();
+
// Do housekeeping if the time interval has elapsed since the last check
if((timeNow - mLastHousekeepingRun) < housekeepingInterval)
{
@@ -170,6 +172,11 @@
// --------------------------------------------------------------------------
bool BackupStoreDaemon::CheckForInterProcessMsg(int AccountNum, int MaximumWaitTime)
{
+ if(!mInterProcessCommsSocket.IsOpened())
+ {
+ return false;
+ }
+
// First, check to see if it's EOF -- this means something has gone wrong, and the housekeeping should terminate.
if(mInterProcessComms.IsEOF())
{