summaryrefslogtreecommitdiffstats
path: root/applypatch
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2016-11-29 19:09:12 +0100
committerandroid-build-merger <android-build-merger@google.com>2016-11-29 19:09:12 +0100
commit6478f3804d68fd4d45406944170f9da4018c00e2 (patch)
tree073af2fb4db947ed990c3184da780e028a032b98 /applypatch
parentMerge "Add ota_close(unique_fd&) and ota_fclose(std::unique_ptr<FILE>&)." am: eed7f607cf am: 839fbbdad3 (diff)
parentMerge "Remove ota_close(int) and ota_fclose(FILE*)." am: 7b59b45b08 (diff)
downloadandroid_bootable_recovery-6478f3804d68fd4d45406944170f9da4018c00e2.tar
android_bootable_recovery-6478f3804d68fd4d45406944170f9da4018c00e2.tar.gz
android_bootable_recovery-6478f3804d68fd4d45406944170f9da4018c00e2.tar.bz2
android_bootable_recovery-6478f3804d68fd4d45406944170f9da4018c00e2.tar.lz
android_bootable_recovery-6478f3804d68fd4d45406944170f9da4018c00e2.tar.xz
android_bootable_recovery-6478f3804d68fd4d45406944170f9da4018c00e2.tar.zst
android_bootable_recovery-6478f3804d68fd4d45406944170f9da4018c00e2.zip
Diffstat (limited to '')
-rw-r--r--applypatch/applypatch.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/applypatch/applypatch.cpp b/applypatch/applypatch.cpp
index 0250407a5..95389da6e 100644
--- a/applypatch/applypatch.cpp
+++ b/applypatch/applypatch.cpp
@@ -66,7 +66,7 @@ int LoadFileContents(const char* filename, FileContents* file) {
}
std::vector<unsigned char> data(file->st.st_size);
- std::unique_ptr<FILE, int (*)(FILE*)> f(ota_fopen(filename, "rb"), ota_fclose);
+ unique_file f(ota_fopen(filename, "rb"));
if (!f) {
printf("failed to open \"%s\": %s\n", filename, strerror(errno));
return -1;
@@ -118,7 +118,7 @@ static int LoadPartitionContents(const std::string& filename, FileContents* file
std::sort(pairs.begin(), pairs.end());
const char* partition = pieces[1].c_str();
- std::unique_ptr<FILE, int (*)(FILE*)> dev(ota_fopen(partition, "rb"), ota_fclose);
+ unique_file dev(ota_fopen(partition, "rb"));
if (!dev) {
printf("failed to open emmc partition \"%s\": %s\n", partition, strerror(errno));
return -1;