diff options
author | Chris Wilson <chris+github@qwirx.com> | 2007-02-09 23:10:25 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2007-02-09 23:10:25 +0000 |
commit | e429add69506b45e73123990f38667551acbe3ec (patch) | |
tree | 3bb1f9c30e986a83d60410b028eaedd97fa51abc | |
parent | a80d8dd666cb0476ac4b9c60ad8b5ad991c25a9d (diff) |
Log failure to delete files and directories (refs #3)
-rw-r--r-- | lib/backupclient/BackupClientRestore.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/backupclient/BackupClientRestore.cpp b/lib/backupclient/BackupClientRestore.cpp index 8f29f8ba..e7fdd5fa 100644 --- a/lib/backupclient/BackupClientRestore.cpp +++ b/lib/backupclient/BackupClientRestore.cpp @@ -264,7 +264,7 @@ static int BackupClientRestoreDir(BackupProtocolClient &rConnection, int64_t Dir if(::unlink(rLocalDirectoryName.c_str()) != 0) { ::syslog(LOG_ERR, "Failed to delete " - "directory %s: %s", + "file %s: %s", rLocalDirectoryName.c_str(), strerror(errno)); return Restore_UnknownError; @@ -449,7 +449,14 @@ static int BackupClientRestoreDir(BackupProtocolClient &rConnection, int64_t Dir std::string localFilename(rLocalDirectoryName + DIRECTORY_SEPARATOR_ASCHAR + nm.GetClearFilename()); // Unlink anything which already exists -- for resuming restores, we can't overwrite files already there. - ::unlink(localFilename.c_str()); + if(::unlink(localFilename.c_str()) == 0) + { + ::syslog(LOG_ERR, "Failed to delete " + "file %s: %s", + localFilename.c_str(), + strerror(errno)); + return Restore_UnknownError; + } // Request it from the store rConnection.QueryGetFile(DirectoryID, en->GetObjectID()); |