diff options
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Glacier2/Glacier2Router.cpp | 6 | ||||
-rw-r--r-- | cpp/src/Ice/Service.cpp | 4 | ||||
-rw-r--r-- | cpp/src/IceBox/Service.cpp | 6 | ||||
-rw-r--r-- | cpp/src/IceGrid/IceGridNode.cpp | 12 | ||||
-rw-r--r-- | cpp/src/IceGrid/IceGridRegistry.cpp | 6 | ||||
-rw-r--r-- | cpp/src/IcePatch2/Server.cpp | 6 |
6 files changed, 25 insertions, 15 deletions
diff --git a/cpp/src/Glacier2/Glacier2Router.cpp b/cpp/src/Glacier2/Glacier2Router.cpp index 174311cc213..f0bfe9a9097 100644 --- a/cpp/src/Glacier2/Glacier2Router.cpp +++ b/cpp/src/Glacier2/Glacier2Router.cpp @@ -53,7 +53,7 @@ public: protected: - virtual bool start(int, char*[]); + virtual bool start(int, char*[], int&); virtual bool stop(); virtual CommunicatorPtr initializeCommunicator(int&, char*[], const InitializationData&); @@ -93,7 +93,7 @@ Glacier2::RouterService::RouterService() } bool -Glacier2::RouterService::start(int argc, char* argv[]) +Glacier2::RouterService::start(int argc, char* argv[], int& status) { bool nowarn; @@ -117,11 +117,13 @@ Glacier2::RouterService::start(int argc, char* argv[]) if(opts.isSet("help")) { usage(argv[0]); + status = EXIT_SUCCESS; return false; } if(opts.isSet("version")) { print(ICE_STRING_VERSION); + status = EXIT_SUCCESS; return false; } nowarn = opts.isSet("nowarn"); diff --git a/cpp/src/Ice/Service.cpp b/cpp/src/Ice/Service.cpp index d5720aa222e..a25587f1c50 100644 --- a/cpp/src/Ice/Service.cpp +++ b/cpp/src/Ice/Service.cpp @@ -807,7 +807,7 @@ Ice::Service::run(int& argc, char* argv[], const InitializationData& initData) // // Start the service. // - if(start(argc, argv)) + if(start(argc, argv, status)) { // // Wait for service shutdown. @@ -2018,7 +2018,7 @@ Ice::Service::runDaemon(int argc, char* argv[], const InitializationData& initDa // // Start the service. // - if(start(argc, argv)) + if(start(argc, argv, status)) { // // Notify the parent that the child is ready. diff --git a/cpp/src/IceBox/Service.cpp b/cpp/src/IceBox/Service.cpp index 2cfb70ce1ea..8c44fe7f37b 100644 --- a/cpp/src/IceBox/Service.cpp +++ b/cpp/src/IceBox/Service.cpp @@ -27,7 +27,7 @@ public: protected: - virtual bool start(int, char*[]); + virtual bool start(int, char*[], int&); virtual bool stop(); private: @@ -43,7 +43,7 @@ IceBox::IceBoxService::IceBoxService() } bool -IceBox::IceBoxService::start(int argc, char* argv[]) +IceBox::IceBoxService::start(int argc, char* argv[], int& status) { // Run through the command line arguments removing all the service // properties. @@ -84,11 +84,13 @@ IceBox::IceBoxService::start(int argc, char* argv[]) if(opts.isSet("help")) { usage(argv[0]); + status = EXIT_SUCCESS; return false; } if(opts.isSet("version")) { print(ICE_STRING_VERSION); + status = EXIT_SUCCESS; return false; } diff --git a/cpp/src/IceGrid/IceGridNode.cpp b/cpp/src/IceGrid/IceGridNode.cpp index 20274be9f95..1e74f7800b7 100644 --- a/cpp/src/IceGrid/IceGridNode.cpp +++ b/cpp/src/IceGrid/IceGridNode.cpp @@ -70,8 +70,8 @@ public: protected: - virtual bool start(int, char*[]); - bool startImpl(int, char*[]); + virtual bool start(int, char*[], int&); + bool startImpl(int, char*[], int&); virtual void waitForShutdown(); virtual bool stop(); virtual CommunicatorPtr initializeCommunicator(int&, char*[], const InitializationData&); @@ -182,11 +182,11 @@ NodeService::shutdown() } bool -NodeService::start(int argc, char* argv[]) +NodeService::start(int argc, char* argv[], int& status) { try { - if(!startImpl(argc, argv)) + if(!startImpl(argc, argv, status)) { stop(); return false; @@ -201,7 +201,7 @@ NodeService::start(int argc, char* argv[]) } bool -NodeService::startImpl(int argc, char* argv[]) +NodeService::startImpl(int argc, char* argv[], int& status) { bool nowarn = false; bool readonly = false; @@ -212,11 +212,13 @@ NodeService::startImpl(int argc, char* argv[]) if(strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "--help") == 0) { usage(argv[0]); + status = EXIT_SUCCESS; return false; } else if(strcmp(argv[i], "-v") == 0 || strcmp(argv[i], "--version") == 0) { print(ICE_STRING_VERSION); + status = EXIT_SUCCESS; return false; } else if(strcmp(argv[i], "--nowarn") == 0) diff --git a/cpp/src/IceGrid/IceGridRegistry.cpp b/cpp/src/IceGrid/IceGridRegistry.cpp index dee4855e44f..5a961147a0f 100644 --- a/cpp/src/IceGrid/IceGridRegistry.cpp +++ b/cpp/src/IceGrid/IceGridRegistry.cpp @@ -31,7 +31,7 @@ public: protected: - virtual bool start(int, char*[]); + virtual bool start(int, char*[], int&); virtual void waitForShutdown(); virtual bool stop(); virtual CommunicatorPtr initializeCommunicator(int&, char*[], const InitializationData&); @@ -62,7 +62,7 @@ RegistryService::shutdown() } bool -RegistryService::start(int argc, char* argv[]) +RegistryService::start(int argc, char* argv[], int& status) { bool nowarn; bool readonly; @@ -88,11 +88,13 @@ RegistryService::start(int argc, char* argv[]) if(opts.isSet("help")) { usage(argv[0]); + status = EXIT_SUCCESS; return false; } if(opts.isSet("version")) { print(ICE_STRING_VERSION); + status = EXIT_SUCCESS; return false; } nowarn = opts.isSet("nowarn"); diff --git a/cpp/src/IcePatch2/Server.cpp b/cpp/src/IcePatch2/Server.cpp index 0678927b886..fdb68fdedb6 100644 --- a/cpp/src/IcePatch2/Server.cpp +++ b/cpp/src/IcePatch2/Server.cpp @@ -49,7 +49,7 @@ public: protected: - virtual bool start(int, char*[]); + virtual bool start(int, char*[], int&); virtual bool stop(); private: @@ -64,7 +64,7 @@ IcePatch2::PatcherService::PatcherService() } bool -IcePatch2::PatcherService::start(int argc, char* argv[]) +IcePatch2::PatcherService::start(int argc, char* argv[], int& status) { PropertiesPtr properties = communicator()->getProperties(); @@ -87,11 +87,13 @@ IcePatch2::PatcherService::start(int argc, char* argv[]) if(opts.isSet("help")) { usage(argv[0]); + status = EXIT_SUCCESS; return false; } if(opts.isSet("version")) { print(ICE_STRING_VERSION); + status = EXIT_SUCCESS; return false; } |