From 20de27fa7ed8ba789c0859b8e858610419fcb2c6 Mon Sep 17 00:00:00 2001 From: Matthew Newhook Date: Fri, 16 Dec 2005 17:16:05 +0000 Subject: http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=679 --- cpp/src/IcePatch2/Server.cpp | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'cpp/src/IcePatch2/Server.cpp') diff --git a/cpp/src/IcePatch2/Server.cpp b/cpp/src/IcePatch2/Server.cpp index cb45d297add..2b41f666018 100644 --- a/cpp/src/IcePatch2/Server.cpp +++ b/cpp/src/IcePatch2/Server.cpp @@ -11,10 +11,7 @@ #include #include #include - -#ifdef _WIN32 -# include -#endif +#include using namespace std; using namespace Ice; @@ -123,18 +120,13 @@ IcePatch2::PatcherService::start(int argc, char* argv[]) { if(!isAbsolute(dataDir)) { -#ifdef _WIN32 - char cwd[_MAX_PATH]; - if(_getcwd(cwd, _MAX_PATH) == NULL) -#else - char cwd[PATH_MAX]; - if(getcwd(cwd, PATH_MAX) == NULL) -#endif + string cwd; + if(OS::getcwd(cwd) != 0) { throw "cannot get the current directory:\n" + lastError(); } - dataDir = string(cwd) + '/' + dataDir; + dataDir = cwd + '/' + dataDir; } loadFileInfoSeq(dataDir, infoSeq); @@ -169,7 +161,7 @@ IcePatch2::PatcherService::start(int argc, char* argv[]) string instanceName = properties->getPropertyWithDefault(instanceNameProperty, "IcePatch2"); const string idProperty = "IcePatch2.Identity"; - string idStr= properties->getProperty(idProperty); + string idStr = properties->getProperty(idProperty); if(idStr.empty()) { idStr = instanceName + "/server"; -- cgit v1.2.3