diff options
author | Benoit Foucher <benoit@zeroc.com> | 2007-01-25 14:17:48 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2007-01-25 14:17:48 +0000 |
commit | 0d6e66e98a11e8fa70d53c9e304eaf08bfc0a072 (patch) | |
tree | 1b1a7ce9b43ca3c4b4d2f1e138ee6dd9716fb70c /cpp/src/IceGrid/PlatformInfo.cpp | |
parent | http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=1283 (diff) | |
download | ice-0d6e66e98a11e8fa70d53c9e304eaf08bfc0a072.tar.bz2 ice-0d6e66e98a11e8fa70d53c9e304eaf08bfc0a072.tar.xz ice-0d6e66e98a11e8fa70d53c9e304eaf08bfc0a072.zip |
IceGrid file cache fixes
Diffstat (limited to 'cpp/src/IceGrid/PlatformInfo.cpp')
-rw-r--r-- | cpp/src/IceGrid/PlatformInfo.cpp | 29 |
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() |