summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bin/bbackupd/BackupDaemon.cpp6
-rw-r--r--lib/common/BoxPlatform.h5
-rw-r--r--lib/raidfile/RaidFileRead.cpp4
-rw-r--r--lib/raidfile/RaidFileWrite.cpp4
-rw-r--r--lib/win32/emu.h2
5 files changed, 13 insertions, 8 deletions
diff --git a/bin/bbackupd/BackupDaemon.cpp b/bin/bbackupd/BackupDaemon.cpp
index bd2c179b..4ca92aad 100644
--- a/bin/bbackupd/BackupDaemon.cpp
+++ b/bin/bbackupd/BackupDaemon.cpp
@@ -203,7 +203,8 @@ BackupDaemon::BackupDaemon()
mpProgressNotifier(this),
mpLocationResolver(this),
mpRunStatusProvider(this),
- mpSysadminNotifier(this)
+ mpSysadminNotifier(this),
+ mapCommandSocketPollTimer(NULL)
#ifdef WIN32
, mInstallService(false),
mRemoveService(false),
@@ -443,6 +444,9 @@ void BackupDaemon::Run()
// initialise global timer mechanism
Timers::Init();
+ mapCommandSocketPollTimer.reset(new Timer(COMMAND_SOCKET_POLL_INTERVAL,
+ "CommandSocketPollTimer"));
+
#ifndef WIN32
// Ignore SIGPIPE so that if a command connection is broken,
// the daemon doesn't terminate.
diff --git a/lib/common/BoxPlatform.h b/lib/common/BoxPlatform.h
index 53a967e8..06f34d5c 100644
--- a/lib/common/BoxPlatform.h
+++ b/lib/common/BoxPlatform.h
@@ -40,9 +40,12 @@
#endif
#endif
+#include "emu.h"
+
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
+
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#else
@@ -182,8 +185,6 @@
#define WIN32_LEAN_AND_MEAN
#endif
-#include "emu.h"
-
#ifdef WIN32
#define INVALID_FILE INVALID_HANDLE_VALUE
typedef HANDLE tOSFileHandle;
diff --git a/lib/raidfile/RaidFileRead.cpp b/lib/raidfile/RaidFileRead.cpp
index a78ec4a2..1396b4cd 100644
--- a/lib/raidfile/RaidFileRead.cpp
+++ b/lib/raidfile/RaidFileRead.cpp
@@ -44,8 +44,8 @@
#define READ_NUMBER_DISCS_REQUIRED 3
#define READV_MAX_BLOCKS 64
-// We want to use POSIX fstat() for now, not the emulated one
-#undef fstat
+// We want to use POSIX fstat() for now, not the emulated one, because it's
+// difficult to rewrite all this code to use HANDLEs instead of ints.
// --------------------------------------------------------------------------
//
diff --git a/lib/raidfile/RaidFileWrite.cpp b/lib/raidfile/RaidFileWrite.cpp
index ddc99fc7..f06a2472 100644
--- a/lib/raidfile/RaidFileWrite.cpp
+++ b/lib/raidfile/RaidFileWrite.cpp
@@ -42,8 +42,8 @@
// Must have this number of discs in the set
#define TRANSFORM_NUMBER_DISCS_REQUIRED 3
-// we want to use POSIX fstat() for now, not the emulated one
-#undef fstat
+// We want to use POSIX fstat() for now, not the emulated one, because it's
+// difficult to rewrite all this code to use HANDLEs instead of ints.
// --------------------------------------------------------------------------
//
diff --git a/lib/win32/emu.h b/lib/win32/emu.h
index cd4e2f4e..acc91b15 100644
--- a/lib/win32/emu.h
+++ b/lib/win32/emu.h
@@ -279,7 +279,7 @@ void syslog (int loglevel, const char *fmt, ...);
#define strtoll _strtoi64
#endif
-inline unsigned int sleep(unsigned int secs)
+extern "C" inline unsigned int sleep(unsigned int secs)
{
Sleep(secs*1000);
return(ERROR_SUCCESS);