From 3661f3624acc46590d5504fda4f8714255fb2c8e Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 4 Apr 2008 21:59:29 +0000 Subject: Tailorization Import of the upstream sources from Repository: http://localhost:8000/ Kind: hg Revision: 7807b7768163f1c2537756abe5416063989cebb1 Original author: tailor@rocio.int.aidworld.org Date: 2008-03-16 19:44:36+00:00 --- lib/backupclient/BackupClientRestore.cpp | 36 ++++++++++++++------------------ 1 file changed, 16 insertions(+), 20 deletions(-) (limited to 'lib/backupclient/BackupClientRestore.cpp') diff --git a/lib/backupclient/BackupClientRestore.cpp b/lib/backupclient/BackupClientRestore.cpp index aab514ad..b5a54964 100644 --- a/lib/backupclient/BackupClientRestore.cpp +++ b/lib/backupclient/BackupClientRestore.cpp @@ -267,14 +267,14 @@ static int BackupClientRestoreDir(BackupProtocolClient &rConnection, int64_t Dir "restore this object."); if(::unlink(rLocalDirectoryName.c_str()) != 0) { - BOX_LOG_SYS_ERROR("Failed to delete " - "file '" << - rLocalDirectoryName << "'"); + BOX_ERROR("Failed to delete file " << + rLocalDirectoryName << ": " << + strerror(errno)); return Restore_UnknownError; } BOX_TRACE("In restore, directory name " - "collision with file '" << - rLocalDirectoryName << "'"); + "collision with file " << + rLocalDirectoryName); } break; case ObjectExists_NoObject: @@ -378,8 +378,9 @@ static int BackupClientRestoreDir(BackupProtocolClient &rConnection, int64_t Dir exists == ObjectExists_File) && ::mkdir(rLocalDirectoryName.c_str(), S_IRWXU) != 0) { - BOX_LOG_SYS_ERROR("Failed to create directory '" << - rLocalDirectoryName << "'"); + BOX_ERROR("Failed to create directory '" << + rLocalDirectoryName << "': " << + strerror(errno)); return Restore_UnknownError; } @@ -450,9 +451,7 @@ static int BackupClientRestoreDir(BackupProtocolClient &rConnection, int64_t Dir { // Local name BackupStoreFilenameClear nm(en->GetName()); - std::string localFilename(rLocalDirectoryName + - DIRECTORY_SEPARATOR_ASCHAR + - nm.GetClearFilename()); + std::string localFilename(rLocalDirectoryName + DIRECTORY_SEPARATOR_ASCHAR + nm.GetClearFilename()); // Unlink anything which already exists: // For resuming restores, we can't overwrite @@ -460,23 +459,20 @@ static int BackupClientRestoreDir(BackupProtocolClient &rConnection, int64_t Dir if(ObjectExists(localFilename) != ObjectExists_NoObject && ::unlink(localFilename.c_str()) != 0) { - BOX_LOG_SYS_ERROR("Failed to delete " - "file '" << localFilename << - "'"); + BOX_ERROR("Failed to delete file '" << + localFilename << "': " << + strerror(errno)); return Restore_UnknownError; } // Request it from the store - rConnection.QueryGetFile(DirectoryID, - en->GetObjectID()); + rConnection.QueryGetFile(DirectoryID, en->GetObjectID()); // Stream containing encoded file - std::auto_ptr objectStream( - rConnection.ReceiveStream()); + std::auto_ptr objectStream(rConnection.ReceiveStream()); - // Decode the file -- need to do different - // things depending on whether the directory - // entry has additional attributes + // Decode the file -- need to do different things depending on whether + // the directory entry has additional attributes try { if(en->HasAttributes()) -- cgit v1.2.3