Skip to content

Commit

Permalink
Fix thinko in windows EFS support.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco van Wieringen committed Feb 17, 2015
1 parent e01d924 commit 8b3eaae
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions src/filed/restore.c
Expand Up @@ -1178,6 +1178,7 @@ bool store_data(JCR *jcr, BFILE *bfd, char *data, const int32_t length, bool win
if (jcr->crypto.digest) {
crypto_digest_update(jcr->crypto.digest, (uint8_t *)data, length);
}

if (win32_decomp) {
if (!processWin32BackupAPIBlock(bfd, data, length)) {
berrno be;
Expand All @@ -1186,22 +1187,28 @@ bool store_data(JCR *jcr, BFILE *bfd, char *data, const int32_t length, bool win
return false;
}
#ifdef HAVE_WIN32
} else if (!bfd->encrypted && bwrite(bfd, data, length) != (ssize_t)length) {
} else {
if (bfd->encrypted) {
if (win32_send_to_copy_thread(jcr, bfd, data, length) != (ssize_t)length) {
berrno be;
Jmsg2(jcr, M_ERROR, 0, _("Write error on %s: %s\n"),
jcr->last_fname, be.bstrerror(bfd->berrno));
return false;
}
} else {
if (bwrite(bfd, data, length) != (ssize_t)length) {
berrno be;
Jmsg2(jcr, M_ERROR, 0, _("Write error on %s: %s\n"),
jcr->last_fname, be.bstrerror(bfd->berrno));
}
}
}
#else
} else if (bwrite(bfd, data, length) != (ssize_t)length) {
#endif
berrno be;
Jmsg2(jcr, M_ERROR, 0, _("Write error on %s: %s\n"),
jcr->last_fname, be.bstrerror(bfd->berrno));
return false;
#ifdef HAVE_WIN32
} else if (win32_send_to_copy_thread(jcr, bfd, data, length) != (ssize_t)length) {
berrno be;
Jmsg2(jcr, M_ERROR, 0, _("Write error on %s: %s\n"),
jcr->last_fname, be.bstrerror(bfd->berrno));
return false;
}
#else
}
#endif

Expand Down

0 comments on commit 8b3eaae

Please sign in to comment.