summaryrefslogtreecommitdiffstats
path: root/applypatch/applypatch.cpp
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2016-11-21 20:42:38 +0100
committerandroid-build-merger <android-build-merger@google.com>2016-11-21 20:42:38 +0100
commitd8e4f12ae03356b46b024cf4e9e078519f3d2553 (patch)
tree5e6f22a2bba3ef36dd8ba1ecbf3c7447e09ed781 /applypatch/applypatch.cpp
parentMerge "Fail gracefully when we fail to fork the update binary" am: 340a2d364f am: 2a962adc85 (diff)
parentMerge "applypatch: Release FD when explicitly calling close." am: a511a3c407 (diff)
downloadandroid_bootable_recovery-d8e4f12ae03356b46b024cf4e9e078519f3d2553.tar
android_bootable_recovery-d8e4f12ae03356b46b024cf4e9e078519f3d2553.tar.gz
android_bootable_recovery-d8e4f12ae03356b46b024cf4e9e078519f3d2553.tar.bz2
android_bootable_recovery-d8e4f12ae03356b46b024cf4e9e078519f3d2553.tar.lz
android_bootable_recovery-d8e4f12ae03356b46b024cf4e9e078519f3d2553.tar.xz
android_bootable_recovery-d8e4f12ae03356b46b024cf4e9e078519f3d2553.tar.zst
android_bootable_recovery-d8e4f12ae03356b46b024cf4e9e078519f3d2553.zip
Diffstat (limited to 'applypatch/applypatch.cpp')
-rw-r--r--applypatch/applypatch.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/applypatch/applypatch.cpp b/applypatch/applypatch.cpp
index 9b84fa104..41a8d582b 100644
--- a/applypatch/applypatch.cpp
+++ b/applypatch/applypatch.cpp
@@ -210,7 +210,7 @@ int SaveFileContents(const char* filename, const FileContents* file) {
printf("fsync of \"%s\" failed: %s\n", filename, strerror(errno));
return -1;
}
- if (ota_close(fd) != 0) {
+ if (ota_close(fd.release()) != 0) {
printf("close of \"%s\" failed: %s\n", filename, strerror(errno));
return -1;
}
@@ -268,7 +268,7 @@ int WriteToPartition(const unsigned char* data, size_t len, const std::string& t
printf("failed to sync to %s: %s\n", partition, strerror(errno));
return -1;
}
- if (ota_close(fd) != 0) {
+ if (ota_close(fd.release()) != 0) {
printf("failed to close %s: %s\n", partition, strerror(errno));
return -1;
}
@@ -287,7 +287,7 @@ int WriteToPartition(const unsigned char* data, size_t len, const std::string& t
} else {
printf(" caches dropped\n");
}
- ota_close(dc);
+ ota_close(dc.release());
sleep(1);
// Verify.
@@ -339,7 +339,7 @@ int WriteToPartition(const unsigned char* data, size_t len, const std::string& t
return -1;
}
- if (ota_close(fd) == -1) {
+ if (ota_close(fd.release()) == -1) {
printf("error closing %s: %s\n", partition, strerror(errno));
return -1;
}
@@ -782,7 +782,7 @@ static int GenerateTarget(FileContents* source_file,
printf("failed to fsync file \"%s\": %s\n", tmp_target_filename.c_str(), strerror(errno));
result = 1;
}
- if (ota_close(output_fd) != 0) {
+ if (ota_close(output_fd.release()) != 0) {
printf("failed to close file \"%s\": %s\n", tmp_target_filename.c_str(), strerror(errno));
result = 1;
}