diff options
author | Chris Wilson <chris+github@qwirx.com> | 2007-04-28 17:32:24 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2007-04-28 17:32:24 +0000 |
commit | 503d68413c525aa84430c9e6c6b27eee1eaefbe4 (patch) | |
tree | a9e262413394c44bd55416da47f84a9e8aae30c9 /lib/server/Daemon.cpp | |
parent | 41b16f3b27f87d2f84e59387e78644c05756e307 (diff) |
Make Daemon remember whether we're supposed to run in a single process,
or not. (refs #3)
Diffstat (limited to 'lib/server/Daemon.cpp')
-rw-r--r-- | lib/server/Daemon.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/server/Daemon.cpp b/lib/server/Daemon.cpp index c639309a..4cb33c57 100644 --- a/lib/server/Daemon.cpp +++ b/lib/server/Daemon.cpp @@ -101,7 +101,6 @@ int Daemon::Main(const char *DefaultConfigFile, int argc, const char *argv[]) // Find filename of config file mConfigFileName = DefaultConfigFile; bool haveConfigFile = false; - bool singleProcess = false; #ifdef NDEBUG int masterLevel = Log::NOTICE; // need an int to do math with @@ -125,7 +124,7 @@ int Daemon::Main(const char *DefaultConfigFile, int argc, const char *argv[]) case 'D': { - singleProcess = true; + mSingleProcess = true; } break; @@ -203,7 +202,7 @@ int Daemon::Main(const char *DefaultConfigFile, int argc, const char *argv[]) if (argc > optind && ::strcmp(argv[optind], "SINGLEPROCESS") == 0) { - singleProcess = true; optind++; + mSingleProcess = true; optind++; } if (argc > optind) @@ -215,19 +214,20 @@ int Daemon::Main(const char *DefaultConfigFile, int argc, const char *argv[]) Logging::SetGlobalLevel((Log::Level)masterLevel); - return Main(mConfigFileName, singleProcess); + // return Main(mConfigFileName, mSingleProcess); + return Main(mConfigFileName); } // -------------------------------------------------------------------------- // // Function -// Name: Daemon::Main(const std::string& rConfigFileName, -// bool singleProcess) +// Name: Daemon::Main(const std::string& rConfigFileName) // Purpose: Starts the daemon off -- equivalent of C main() function // Created: 2003/07/29 // // -------------------------------------------------------------------------- -int Daemon::Main(const std::string &rConfigFileName, bool singleProcess) +// int Daemon::Main(const std::string &rConfigFileName, bool singleProcess) +int Daemon::Main(const std::string &rConfigFileName) { // Banner (optional) { @@ -241,7 +241,8 @@ int Daemon::Main(const std::string &rConfigFileName, bool singleProcess) std::string pidFileName; mConfigFileName = rConfigFileName; - bool asDaemon = !singleProcess; + + bool asDaemon = !mSingleProcess; try { |