summaryrefslogtreecommitdiff
path: root/cpp/src/IcePatch2/ClientUtil.cpp
diff options
context:
space:
mode:
authorMichi Henning <michi@zeroc.com>2005-01-15 03:48:58 +0000
committerMichi Henning <michi@zeroc.com>2005-01-15 03:48:58 +0000
commita10790013db672523147d38c0b1be2b5614719db (patch)
tree40cb7da4ac2f7fe9383589c88c99812321b48b24 /cpp/src/IcePatch2/ClientUtil.cpp
parentAdded missing IcePatch2 Makefile. (diff)
downloadice-a10790013db672523147d38c0b1be2b5614719db.tar.bz2
ice-a10790013db672523147d38c0b1be2b5614719db.tar.xz
ice-a10790013db672523147d38c0b1be2b5614719db.zip
Changed Patcher to change dir to data directory.
Diffstat (limited to 'cpp/src/IcePatch2/ClientUtil.cpp')
-rwxr-xr-xcpp/src/IcePatch2/ClientUtil.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/cpp/src/IcePatch2/ClientUtil.cpp b/cpp/src/IcePatch2/ClientUtil.cpp
index 6c392ba5d51..83e5791baab 100755
--- a/cpp/src/IcePatch2/ClientUtil.cpp
+++ b/cpp/src/IcePatch2/ClientUtil.cpp
@@ -142,14 +142,14 @@ private:
IcePatch2::Patcher::Patcher(const CommunicatorPtr& communicator, const PatcherFeedbackPtr& feedback) :
_feedback(feedback),
- _dataDir(normalize(communicator->getProperties()->getProperty("IcePatch2.Directory"))),
+ _dataDir(normalize(communicator->getProperties()->getPropertyWithDefault("IcePatch2.Directory", "."))),
_thorough(communicator->getProperties()->getPropertyAsInt("IcePatch2.Thorough") > 0),
_chunkSize(communicator->getProperties()->getPropertyAsIntWithDefault("IcePatch2.ChunkSize", 100)),
_remove(communicator->getProperties()->getPropertyAsIntWithDefault("IcePatch2.Remove", 1))
{
- if(_dataDir.empty())
+ if(chdir(_dataDir.c_str()) != 0)
{
- throw string("no data directory specified");
+ throw string("cannot change directory to `" + _dataDir + "': " + lastError());
}
int sizeMax = communicator->getProperties()->getPropertyAsIntWithDefault("Ice.MessageSizeMax", 1024);
@@ -421,11 +421,11 @@ IcePatch2::Patcher::prepare()
= equal_range(_removeFiles.begin(), _removeFiles.end(), fi, PathLess());
_removeFiles.erase(p.first, p.second);
- string pathLog = _dataDir + "/" + logFile;
- _log.open(pathLog.c_str());
+ string patchLog = _dataDir + "/" + logFile;
+ _log.open(patchLog.c_str());
if(!_log)
{
- throw "cannot open `" + pathLog + "' for writing:\n" + lastError();
+ throw "cannot open `" + patchLog + "' for writing:\n" + lastError();
}
return true;