summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordeymo@chromium.org <deymo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-14 00:27:21 +0000
committerdeymo@chromium.org <deymo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-14 00:27:21 +0000
commit1525e618009ced313e10a6c85e69078065fd4906 (patch)
tree6616f275c3f056ba0d58397cc1c086dd452da8c1
parent2fb7a1437a51535645a551d195e4d1ddfd79d7ac (diff)
downloadchromium_src-1525e618009ced313e10a6c85e69078065fd4906.zip
chromium_src-1525e618009ced313e10a6c85e69078065fd4906.tar.gz
chromium_src-1525e618009ced313e10a6c85e69078065fd4906.tar.bz2
bspatch: Report errors on MBS_ApplyPatch.
ApplyBinaryPatch() returns an integer value different from 0 on error when opening files. Nevertheless, it doesn't report the errors when they happen on the underlying MBS_ApplyPatch() function. BUG=None TEST=Manually compiled and called ApplyBinaryPatch with an invalid patch. Function returns error instead of 0. Review URL: https://codereview.chromium.org/284733002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@270266 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--third_party/bspatch/README.chromium1
-rw-r--r--third_party/bspatch/mbspatch.cc4
2 files changed, 3 insertions, 2 deletions
diff --git a/third_party/bspatch/README.chromium b/third_party/bspatch/README.chromium
index ad044e3..f9f38a6 100644
--- a/third_party/bspatch/README.chromium
+++ b/third_party/bspatch/README.chromium
@@ -16,3 +16,4 @@ Local changes include CRC32 verification and improvements in error handling.
Update(08 Sep 08): Changed ApplyBinaryPatch to accept wchar_t paths
instead of char paths.
+Update(12 May 13): Report error on MBS_ApplyPatch failure.
diff --git a/third_party/bspatch/mbspatch.cc b/third_party/bspatch/mbspatch.cc
index 164cc3c..d00bc99 100644
--- a/third_party/bspatch/mbspatch.cc
+++ b/third_party/bspatch/mbspatch.cc
@@ -86,7 +86,7 @@ MBS_ReadHeader(int fd, MBSPatchHeader *header)
return OK;
}
-
+
int
MBS_ApplyPatch(const MBSPatchHeader *header, int patchfd,
unsigned char *fbuffer, int filefd)
@@ -263,7 +263,7 @@ int ApplyBinaryPatch(const wchar_t *old_file, const wchar_t *patch_file,
break;
}
- MBS_ApplyPatch(&header, pfd, buf, nfd);
+ ret = MBS_ApplyPatch(&header, pfd, buf, nfd);
} while (0);
free(buf);