summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/Service.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2010-01-05 16:05:31 +0100
committerBenoit Foucher <benoit@zeroc.com>2010-01-05 16:05:31 +0100
commitf427145b04a1aacca0f9323047ce65dff43091d6 (patch)
tree7be4b0e8b54703cbbfd89363915daf091d792b6d /cpp/src/Ice/Service.cpp
parentFix for bug 4538 -- Freeze file lock is now stored in __Freeze subdirectory (diff)
downloadice-f427145b04a1aacca0f9323047ce65dff43091d6.tar.bz2
ice-f427145b04a1aacca0f9323047ce65dff43091d6.tar.xz
ice-f427145b04a1aacca0f9323047ce65dff43091d6.zip
- Check for argc > 0 to access argv[0] in Ice::Service
- Added Ice::Service::main method with char* const[] argv parameter (for OS X) - Minor fix in Proxy.h
Diffstat (limited to 'cpp/src/Ice/Service.cpp')
-rw-r--r--cpp/src/Ice/Service.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/cpp/src/Ice/Service.cpp b/cpp/src/Ice/Service.cpp
index 7aa1217673b..37268b57027 100644
--- a/cpp/src/Ice/Service.cpp
+++ b/cpp/src/Ice/Service.cpp
@@ -501,7 +501,11 @@ Ice::Service::interrupt()
int
Ice::Service::main(int& argc, char* argv[], const InitializationData& initializationData)
{
- _name = argv[0] ? argv[0] : "";
+ _name = "";
+ if(argc > 0)
+ {
+ _name = argv[0];
+ }
//
// We parse the properties here to extract Ice.ProgramName and
@@ -836,6 +840,13 @@ Ice::Service::main(int& argc, char* argv[], const InitializationData& initializa
return run(argc, argv, initData);
}
+int
+Ice::Service::main(int argc, char* const argv[], const InitializationData& initializationData)
+{
+ IceUtilInternal::ArgVector av(argc, argv);
+ return main(av.argc, av.argv, initializationData);
+}
+
#ifdef _WIN32
int
@@ -843,7 +854,7 @@ Ice::Service::main(int& argc, wchar_t* argv[], const InitializationData& initial
{
#ifdef __BCPLUSPLUS__ // COMPILER FIX
//
- //BCC don't see the main overload if we don't create the temp args object here.
+ // BCC doesn't see the main overload if we don't create the temp args object here.
//
Ice::StringSeq args = Ice::argsToStringSeq(argc, argv, initializationData.stringConverter);
return main(args, initializationData);