summaryrefslogtreecommitdiff
path: root/bin/bbstored/BackupStoreDaemon.cpp
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2006-07-27 23:18:35 +0000
committerChris Wilson <chris+github@qwirx.com>2006-07-27 23:18:35 +0000
commitc7662795f519d2b6797e4b1ac7fa4a22afa26310 (patch)
treeb1737dfa78d8e7bfb2d5a7e9831bab91869ade97 /bin/bbstored/BackupStoreDaemon.cpp
parenta85b710c46ec79e968da349304f30945cb9b7bc1 (diff)
* merge
- This is my current patch queue. I think that all of these are safe to apply. This is just under half of the pending changes in chris/general (the easy half).
Diffstat (limited to 'bin/bbstored/BackupStoreDaemon.cpp')
-rw-r--r--bin/bbstored/BackupStoreDaemon.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/bin/bbstored/BackupStoreDaemon.cpp b/bin/bbstored/BackupStoreDaemon.cpp
index 2752893a..24a81ceb 100644
--- a/bin/bbstored/BackupStoreDaemon.cpp
+++ b/bin/bbstored/BackupStoreDaemon.cpp
@@ -11,9 +11,12 @@
#include <stdlib.h>
#include <stdio.h>
-#include <syslog.h>
#include <signal.h>
+#ifdef HAVE_SYSLOG_H
+#include <syslog.h>
+#endif
+
#include "BackupContext.h"
#include "BackupStoreDaemon.h"
#include "BackupStoreConfigVerify.h"
@@ -39,7 +42,11 @@ BackupStoreDaemon::BackupStoreDaemon()
mExtendedLogging(false),
mHaveForkedHousekeeping(false),
mIsHousekeepingProcess(false),
+#ifdef WIN32
+ mHousekeepingInited(false)
+#else
mInterProcessComms(mInterProcessCommsSocket)
+#endif
{
}
@@ -156,6 +163,7 @@ void BackupStoreDaemon::Run()
const Configuration &config(GetConfiguration());
mExtendedLogging = config.GetKeyValueBool("ExtendedLogging");
+#ifndef WIN32
// Fork off housekeeping daemon -- must only do this the first time Run() is called
if(!mHaveForkedHousekeeping)
{
@@ -219,9 +227,11 @@ void BackupStoreDaemon::Run()
}
else
{
+#endif // !WIN32
// In server process -- use the base class to do the magic
ServerTLS<BOX_PORT_BBSTORED>::Run();
+#ifndef WIN32
// Why did it stop? Tell the housekeeping process to do the same
if(IsReloadConfigWanted())
{
@@ -232,6 +242,7 @@ void BackupStoreDaemon::Run()
mInterProcessCommsSocket.Write("t\n", 2);
}
}
+#endif
}
@@ -297,6 +308,8 @@ void BackupStoreDaemon::LogConnectionStats(const char *commonName,
// Log the amount of data transferred
::syslog(LOG_INFO, "Connection statistics for %s: "
"IN=%lld OUT=%lld TOTAL=%lld\n", commonName,
- s.GetBytesRead(), s.GetBytesWritten(),
- s.GetBytesRead() + s.GetBytesWritten());
+ (long long)s.GetBytesRead(),
+ (long long)s.GetBytesWritten(),
+ (long long)s.GetBytesRead() +
+ (long long)s.GetBytesWritten());
}