[Box Backup-commit] COMMIT r1162 - box/chris/merge/bin/bbackupd

boxbackup-dev@fluffy.co.uk boxbackup-dev@fluffy.co.uk
Mon, 13 Nov 2006 16:13:20 +0000


Author: chris
Date: 2006-11-13 16:13:20 +0000 (Mon, 13 Nov 2006)
New Revision: 1162

Modified:
   box/chris/merge/bin/bbackupd/BackupDaemon.cpp
Log:
Initialise cross-platform timers on all platforms, remove win32-specific 
code (refs #9)


Modified: box/chris/merge/bin/bbackupd/BackupDaemon.cpp
===================================================================
--- box/chris/merge/bin/bbackupd/BackupDaemon.cpp	2006-11-13 16:12:09 UTC (rev 1161)
+++ box/chris/merge/bin/bbackupd/BackupDaemon.cpp	2006-11-13 16:13:20 UTC (rev 1162)
@@ -75,6 +75,7 @@
 #include "IOStreamGetLine.h"
 #include "Conversion.h"
 #include "Archive.h"
+#include "Timer.h"
 
 #include "MemLeakFindOn.h"
 
@@ -429,21 +430,19 @@
 // --------------------------------------------------------------------------
 void BackupDaemon::Run()
 {
+	// initialise global timer mechanism
+	Timers::Init();
+	
 #ifdef WIN32
-	// init our own timer for file diff timeouts
-	InitTimer();
-
 	try
 	{
 		Run2();
 	}
 	catch(...)
 	{
-		FiniTimer();
+		Timers::Cleanup();
 		throw;
 	}
-
-	FiniTimer();
 #else // ! WIN32
 	// Ignore SIGPIPE (so that if a command connection is broken, the daemon doesn't terminate)
 	::signal(SIGPIPE, SIG_IGN);
@@ -487,6 +486,8 @@
 			mpCommandSocketInfo = 0;
 		}
 
+		Timers::Cleanup();
+		
 		throw;
 	}
 
@@ -497,6 +498,8 @@
 		mpCommandSocketInfo = 0;
 	}
 #endif
+	
+	Timers::Cleanup();
 }
 
 // --------------------------------------------------------------------------