diff options
author | Matthew Newhook <matthew@zeroc.com> | 2005-12-16 17:16:05 +0000 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2005-12-16 17:16:05 +0000 |
commit | 20de27fa7ed8ba789c0859b8e858610419fcb2c6 (patch) | |
tree | 2ab9a32b38b2c95231d509d57302f544639c5b9d /cpp/src/IcePatch2/Server.cpp | |
parent | added file. (diff) | |
download | ice-20de27fa7ed8ba789c0859b8e858610419fcb2c6.tar.bz2 ice-20de27fa7ed8ba789c0859b8e858610419fcb2c6.tar.xz ice-20de27fa7ed8ba789c0859b8e858610419fcb2c6.zip |
http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=679
Diffstat (limited to 'cpp/src/IcePatch2/Server.cpp')
-rw-r--r-- | cpp/src/IcePatch2/Server.cpp | 18 |
1 files changed, 5 insertions, 13 deletions
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 <Ice/Service.h> #include <IcePatch2/FileServerI.h> #include <IcePatch2/Util.h> - -#ifdef _WIN32 -# include <direct.h> -#endif +#include <OS.h> 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"; |