diff options
author | Chris Wilson <chris+github@qwirx.com> | 2010-06-06 14:18:51 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2010-06-06 14:18:51 +0000 |
commit | a781743ecbb955be9e17d47a5714b19f1e17205d (patch) | |
tree | 44c308b0bf4fdff75c9ad45e64b4dffc4f166a06 | |
parent | d6aa5749dffa351de158af5bdb79b6897328fa98 (diff) |
Replace BOX_FILE_BBACKUPD_DEFAULT_CONFIG with
BOX_GET_DEFAULT_BBACKUPD_CONFIG_FILE.
-rw-r--r-- | bin/bbackupctl/bbackupctl.cpp | 8 | ||||
-rw-r--r-- | bin/bbackupd/bbackupd.cpp | 3 | ||||
-rw-r--r-- | lib/common/BoxPortsAndFiles.h.in | 15 | ||||
-rw-r--r-- | lib/server/Daemon.cpp | 5 | ||||
-rw-r--r-- | lib/server/Daemon.h | 2 |
5 files changed, 16 insertions, 17 deletions
diff --git a/bin/bbackupctl/bbackupctl.cpp b/bin/bbackupctl/bbackupctl.cpp index 8dc8f30e..39f15baf 100644 --- a/bin/bbackupctl/bbackupctl.cpp +++ b/bin/bbackupctl/bbackupctl.cpp @@ -67,13 +67,7 @@ int main(int argc, const char *argv[]) Logging::SetProgramName("bbackupctl"); // Filename for configuration file? - std::string configFilename; - - #ifdef WIN32 - configFilename = BOX_GET_DEFAULT_BBACKUPD_CONFIG_FILE; - #else - configFilename = BOX_FILE_BBACKUPD_DEFAULT_CONFIG; - #endif + std::string configFilename = BOX_GET_DEFAULT_BBACKUPD_CONFIG_FILE; // Quiet? bool quiet = false; diff --git a/bin/bbackupd/bbackupd.cpp b/bin/bbackupd/bbackupd.cpp index d334a2df..8313e193 100644 --- a/bin/bbackupd/bbackupd.cpp +++ b/bin/bbackupd/bbackupd.cpp @@ -46,7 +46,8 @@ int main(int argc, const char *argv[]) #else // !WIN32 BackupDaemon daemon; - ExitCode = daemon.Main(BOX_FILE_BBACKUPD_DEFAULT_CONFIG, argc, argv); + ExitCode = daemon.Main(BOX_GET_DEFAULT_BBACKUPD_CONFIG_FILE, + argc, argv); #endif // WIN32 diff --git a/lib/common/BoxPortsAndFiles.h.in b/lib/common/BoxPortsAndFiles.h.in index 41bad0ba..047a828f 100644 --- a/lib/common/BoxPortsAndFiles.h.in +++ b/lib/common/BoxPortsAndFiles.h.in @@ -32,12 +32,15 @@ #define BOX_GET_DEFAULT_BBSTORED_CONFIG_FILE \ GetDefaultConfigFilePath("bbstored.conf").c_str() #else -#define BOX_FILE_BBACKUPD_DEFAULT_CONFIG "@sysconfdir_expanded@/boxbackup/bbackupd.conf" -#define BOX_FILE_RAIDFILE_DEFAULT_CONFIG "@sysconfdir_expanded@/boxbackup/raidfile.conf" -#define BOX_FILE_BBSTORED_DEFAULT_CONFIG "@sysconfdir_expanded@/boxbackup/bbstored.conf" -#define BOX_FILE_BBACKUPD_OLD_CONFIG "@sysconfdir_expanded@/box/bbackupd.conf" -#define BOX_FILE_RAIDFILE_OLD_CONFIG "@sysconfdir_expanded@/box/raidfile.conf" -#define BOX_FILE_BBSTORED_OLD_CONFIG "@sysconfdir_expanded@/box/bbstored.conf" + #define BOX_FILE_BBACKUPD_OLD_CONFIG "@sysconfdir_expanded@/box/bbackupd.conf" + #define BOX_FILE_RAIDFILE_OLD_CONFIG "@sysconfdir_expanded@/box/raidfile.conf" + #define BOX_FILE_BBSTORED_OLD_CONFIG "@sysconfdir_expanded@/box/bbstored.conf" + #define BOX_GET_DEFAULT_BBACKUPD_CONFIG_FILE \ + std::string("@sysconfdir_expanded@/boxbackup/bbackupd.conf") + #define BOX_GET_DEFAULT_RAIDFILE_CONFIG_FILE \ + std::string("@sysconfdir_expanded@/boxbackup/raidfile.conf") + #define BOX_GET_DEFAULT_BBSTORED_CONFIG_FILE \ + std::string("@sysconfdir_expanded@/boxbackup/bbstored.conf") #endif #endif // BOXPORTSANDFILES__H diff --git a/lib/server/Daemon.cpp b/lib/server/Daemon.cpp index c4026395..abf4d7cb 100644 --- a/lib/server/Daemon.cpp +++ b/lib/server/Daemon.cpp @@ -291,10 +291,11 @@ int Daemon::ProcessOption(signed int option) // Created: 2003/07/29 // // -------------------------------------------------------------------------- -int Daemon::Main(const char *DefaultConfigFile, int argc, const char *argv[]) +int Daemon::Main(const std::string& rDefaultConfigFile, int argc, + const char *argv[]) { // Find filename of config file - mConfigFileName = DefaultConfigFile; + mConfigFileName = rDefaultConfigFile; mAppName = argv[0]; #ifdef BOX_RELEASE_BUILD diff --git a/lib/server/Daemon.h b/lib/server/Daemon.h index a3212a00..82532366 100644 --- a/lib/server/Daemon.h +++ b/lib/server/Daemon.h @@ -40,7 +40,7 @@ private: Daemon(const Daemon &rToCopy); public: - virtual int Main(const char *DefaultConfigFile, int argc, + virtual int Main(const std::string& rDefaultConfigFile, int argc, const char *argv[]); /* override this Main() if you want custom option processing: */ |