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.cpp29
1 files changed, 18 insertions, 11 deletions
diff --git a/cpp/src/IceGrid/PlatformInfo.cpp b/cpp/src/IceGrid/PlatformInfo.cpp
index 67bc0a95db5..e9245b89527 100644
--- a/cpp/src/IceGrid/PlatformInfo.cpp
+++ b/cpp/src/IceGrid/PlatformInfo.cpp
@@ -258,21 +258,22 @@ PlatformInfo::PlatformInfo(const string& prefix,
}
}
- _dataDir = properties->getProperty(prefix + ".Data");
- if(!IcePatch2::isAbsolute(_dataDir))
- {
#ifdef _WIN32
- char cwd[_MAX_PATH];
- if(_getcwd(cwd, _MAX_PATH) == NULL)
+ char cwd[_MAX_PATH];
+ if(_getcwd(cwd, _MAX_PATH) == NULL)
#else
char cwd[PATH_MAX];
- if(getcwd(cwd, PATH_MAX) == NULL)
+ if(getcwd(cwd, PATH_MAX) == NULL)
#endif
- {
- throw "cannot get the current directory:\n" + IcePatch2::lastError();
- }
-
- _dataDir = string(cwd) + '/' + _dataDir;
+ {
+ throw "cannot get the current directory:\n" + IcePatch2::lastError();
+ }
+ _cwd = string(cwd);
+
+ _dataDir = properties->getProperty(prefix + ".Data");
+ if(!IcePatch2::isAbsolute(_dataDir))
+ {
+ _dataDir = _cwd + '/' + _dataDir;
}
if(_dataDir[_dataDir.length() - 1] == '/')
{
@@ -421,6 +422,12 @@ PlatformInfo::getDataDir() const
return _dataDir;
}
+std::string
+PlatformInfo::getCwd() const
+{
+ return _cwd;
+}
+
#ifdef _WIN32
void
PlatformInfo::initQuery()