summaryrefslogtreecommitdiff
path: root/cpp/src/IcePatch/Client.cpp
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2002-04-05 18:40:37 +0000
committerMarc Laukien <marc@zeroc.com>2002-04-05 18:40:37 +0000
commit86f6f01a19f122bfd47c0c2c6badc0f54de01250 (patch)
tree1267a4146a2ea8dd53e13014eb89ae0f81c77467 /cpp/src/IcePatch/Client.cpp
parentfixing ConcurrentModificationException in stopAll (diff)
downloadice-86f6f01a19f122bfd47c0c2c6badc0f54de01250.tar.bz2
ice-86f6f01a19f122bfd47c0c2c6badc0f54de01250.tar.xz
ice-86f6f01a19f122bfd47c0c2c6badc0f54de01250.zip
fixes for WIN32
Diffstat (limited to 'cpp/src/IcePatch/Client.cpp')
-rw-r--r--cpp/src/IcePatch/Client.cpp104
1 files changed, 50 insertions, 54 deletions
diff --git a/cpp/src/IcePatch/Client.cpp b/cpp/src/IcePatch/Client.cpp
index 656722919b1..1e6cb7c14bb 100644
--- a/cpp/src/IcePatch/Client.cpp
+++ b/cpp/src/IcePatch/Client.cpp
@@ -45,62 +45,58 @@ IcePatch::Client::usage()
int
IcePatch::Client::run(int argc, char* argv[])
{
- for (int i = 1; i < argc; ++i)
- {
- if (strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "--help") == 0)
- {
- usage();
- return EXIT_SUCCESS;
- }
- else if (strcmp(argv[i], "-v") == 0 || strcmp(argv[i], "--version") == 0)
- {
- cout << ICE_STRING_VERSION << endl;
- return EXIT_SUCCESS;
- }
- else
- {
- cerr << appName() << ": unknown option `" << argv[i] << "'" << endl;
- usage();
- return EXIT_FAILURE;
- }
- }
-
- PropertiesPtr properties = communicator()->getProperties();
-
- //
- // Get the working directory and change to this directory.
- //
- const char* directoryProperty = "IcePatch.Directory";
- string directory = properties->getProperty(directoryProperty);
- if (!directory.empty())
- {
- if (chdir(directory.c_str()) == -1)
- {
- cerr << appName() << ": can't change to directory `" << directory << "': " << strerror(errno) << endl;
- return EXIT_FAILURE;
- }
- }
-
- //
- // Get the IcePatch endpoints.
- //
- const char* endpointsProperty = "IcePatch.Endpoints";
- string endpoints = properties->getProperty(endpointsProperty);
- if (endpoints.empty())
- {
- cerr << appName() << ": property `" << endpointsProperty << "' is not set" << endl;
- return EXIT_FAILURE;
- }
-
- //
- // Create and install the node description factory.
- //
- ObjectFactoryPtr factory = new NodeDescFactory;
- communicator()->addObjectFactory(factory, "::IcePatch::DirectoryDesc");
- communicator()->addObjectFactory(factory, "::IcePatch::FileDesc");
-
try
{
+ for (int i = 1; i < argc; ++i)
+ {
+ if (strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "--help") == 0)
+ {
+ usage();
+ return EXIT_SUCCESS;
+ }
+ else if (strcmp(argv[i], "-v") == 0 || strcmp(argv[i], "--version") == 0)
+ {
+ cout << ICE_STRING_VERSION << endl;
+ return EXIT_SUCCESS;
+ }
+ else
+ {
+ cerr << appName() << ": unknown option `" << argv[i] << "'" << endl;
+ usage();
+ return EXIT_FAILURE;
+ }
+ }
+
+ PropertiesPtr properties = communicator()->getProperties();
+
+ //
+ // Get the IcePatch endpoints.
+ //
+ const char* endpointsProperty = "IcePatch.Endpoints";
+ string endpoints = properties->getProperty(endpointsProperty);
+ if (endpoints.empty())
+ {
+ cerr << appName() << ": property `" << endpointsProperty << "' is not set" << endl;
+ return EXIT_FAILURE;
+ }
+
+ //
+ // Get the working directory and change to this directory.
+ //
+ const char* directoryProperty = "IcePatch.Directory";
+ string directory = properties->getProperty(directoryProperty);
+ if (!directory.empty())
+ {
+ changeDirectory(directory);
+ }
+
+ //
+ // Create and install the node description factory.
+ //
+ ObjectFactoryPtr factory = new NodeDescFactory;
+ communicator()->addObjectFactory(factory, "::IcePatch::DirectoryDesc");
+ communicator()->addObjectFactory(factory, "::IcePatch::FileDesc");
+
//
// Display node structure.
//