summaryrefslogtreecommitdiffstats
path: root/otafault
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2016-11-18 03:15:41 +0100
committerandroid-build-merger <android-build-merger@google.com>2016-11-18 03:15:41 +0100
commit7028ab255f1751292ce57f0f3b6a763494e3805b (patch)
tree673809cc2e8d2e735e6656f11d581b3b694a7e25 /otafault
parentMerge "updater: Add "write_value()" function." am: d00046b691 am: 100dba35f9 (diff)
parentMerge "applypatch: Use unique_fd to avoid leaking FDs." am: 2e5cf3c0bc (diff)
downloadandroid_bootable_recovery-7028ab255f1751292ce57f0f3b6a763494e3805b.tar
android_bootable_recovery-7028ab255f1751292ce57f0f3b6a763494e3805b.tar.gz
android_bootable_recovery-7028ab255f1751292ce57f0f3b6a763494e3805b.tar.bz2
android_bootable_recovery-7028ab255f1751292ce57f0f3b6a763494e3805b.tar.lz
android_bootable_recovery-7028ab255f1751292ce57f0f3b6a763494e3805b.tar.xz
android_bootable_recovery-7028ab255f1751292ce57f0f3b6a763494e3805b.tar.zst
android_bootable_recovery-7028ab255f1751292ce57f0f3b6a763494e3805b.zip
Diffstat (limited to 'otafault')
-rw-r--r--otafault/ota_io.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/otafault/ota_io.h b/otafault/ota_io.h
index 84187a76e..e119eef08 100644
--- a/otafault/ota_io.h
+++ b/otafault/ota_io.h
@@ -26,6 +26,8 @@
#include <stdio.h>
#include <sys/stat.h>
+#include <android-base/unique_fd.h>
+
#define OTAIO_CACHE_FNAME "/cache/saved.file"
void ota_set_fault_files();
@@ -50,4 +52,12 @@ ssize_t ota_write(int fd, const void* buf, size_t nbyte);
int ota_fsync(int fd);
+struct OtaCloser {
+ static void Close(int fd) {
+ ota_close(fd);
+ }
+};
+
+using unique_fd = android::base::unique_fd_impl<OtaCloser>;
+
#endif