summaryrefslogtreecommitdiff
path: root/src/VBox/Main/src-client/GuestCtrlImplTasks.cpp
diff options
context:
space:
mode:
authorFelix Geyer <debfx-pkg@fobos.de>2011-10-17 14:18:31 +0200
committerFelix Geyer <debfx-pkg@fobos.de>2011-10-17 14:18:31 +0200
commit1cf00a61132b69bc7e27254fdd74bf105d2da28c (patch)
treea7d314cc5ec77b4ce3e1f037af600b53ae1d43f8 /src/VBox/Main/src-client/GuestCtrlImplTasks.cpp
parentf8fd93b0b6b13ba94584bb61c1efd1a761f438c9 (diff)
downloadvirtualbox-1cf00a61132b69bc7e27254fdd74bf105d2da28c.tar.gz
Imported Upstream version 4.1.4-dfsgupstream/4.1.4-dfsg
Diffstat (limited to 'src/VBox/Main/src-client/GuestCtrlImplTasks.cpp')
-rw-r--r--src/VBox/Main/src-client/GuestCtrlImplTasks.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/VBox/Main/src-client/GuestCtrlImplTasks.cpp b/src/VBox/Main/src-client/GuestCtrlImplTasks.cpp
index 8f12624dd..b026322b3 100644
--- a/src/VBox/Main/src-client/GuestCtrlImplTasks.cpp
+++ b/src/VBox/Main/src-client/GuestCtrlImplTasks.cpp
@@ -464,6 +464,8 @@ HRESULT Guest::taskCopyFileFromGuest(GuestTask *aTask)
Guest::tr("Source file \"%s\" does not exist, or is not a file"),
aTask->strSource.c_str());
}
+ else
+ rc = GuestTask::setProgressErrorInfo(rc, aTask->progress, pGuest);
/* Query file size to make an estimate for our progress object. */
if (SUCCEEDED(rc))
@@ -538,7 +540,7 @@ HRESULT Guest::taskCopyFileFromGuest(GuestTask *aTask)
RTFILE hFileDest;
int vrc = RTFileOpen(&hFileDest, aTask->strDest.c_str(),
- RTFILE_O_READWRITE | RTFILE_O_OPEN_CREATE | RTFILE_O_DENY_WRITE);
+ RTFILE_O_WRITE | RTFILE_O_OPEN_CREATE | RTFILE_O_DENY_WRITE);
if (RT_FAILURE(vrc))
rc = GuestTask::setProgressErrorInfo(VBOX_E_IPRT_ERROR, aTask->progress,
Guest::tr("Unable to create/open destination file \"%s\", rc=%Rrc"),
@@ -557,10 +559,18 @@ HRESULT Guest::taskCopyFileFromGuest(GuestTask *aTask)
{
if (!aOutputData.size())
{
- if (cbToRead)
+ /*
+ * Only bitch about an unexpected end of a file when there already
+ * was data read from that file. If this was the very first read we can
+ * be (almost) sure that this file is not meant to be read by the specified user.
+ */
+ if ( cbTransfered
+ && cbToRead)
+ {
rc = GuestTask::setProgressErrorInfo(VBOX_E_IPRT_ERROR, aTask->progress,
- Guest::tr("Unexpected end of file \"%s\" (%u bytes left)"),
- aTask->strSource.c_str(), cbToRead);
+ Guest::tr("Unexpected end of file \"%s\" (%u bytes left, %u bytes written)"),
+ aTask->strSource.c_str(), cbToRead, cbTransfered);
+ }
break;
}