summaryrefslogtreecommitdiff
path: root/cpp/src/IceGrid/PlatformInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/IceGrid/PlatformInfo.cpp')
-rw-r--r--cpp/src/IceGrid/PlatformInfo.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/cpp/src/IceGrid/PlatformInfo.cpp b/cpp/src/IceGrid/PlatformInfo.cpp
index 0f6eacd18a7..4e14fa0355c 100644
--- a/cpp/src/IceGrid/PlatformInfo.cpp
+++ b/cpp/src/IceGrid/PlatformInfo.cpp
@@ -21,7 +21,6 @@
#include <climits>
#if defined(_WIN32)
-# include <direct.h> // For _getcwd
# include <pdhmsg.h> // For PDH_MORE_DATA
#else
# include <sys/utsname.h>
@@ -268,13 +267,8 @@ PlatformInfo::PlatformInfo(const string& prefix,
_endpoints = properties->getProperty(endpointsPrefix + ".Endpoints");
}
-#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(IceUtilInternal::getcwd(cwd) != 0)
{
throw "cannot get the current directory:\n" + IceUtilInternal::lastErrorToString();
}