summaryrefslogtreecommitdiffstats
path: root/otafault/ota_io.h
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2016-11-17 20:24:07 +0100
committerTao Bao <tbao@google.com>2016-11-17 21:01:44 +0100
commit6e02ea92ec8af1da74f55e616b7cda82740dccc0 (patch)
tree03b04c72b6a904eb8798a8bef010877c7fe33f2c /otafault/ota_io.h
parentapplypatch: Clean up LoadPartitionContents(). (diff)
downloadandroid_bootable_recovery-6e02ea92ec8af1da74f55e616b7cda82740dccc0.tar
android_bootable_recovery-6e02ea92ec8af1da74f55e616b7cda82740dccc0.tar.gz
android_bootable_recovery-6e02ea92ec8af1da74f55e616b7cda82740dccc0.tar.bz2
android_bootable_recovery-6e02ea92ec8af1da74f55e616b7cda82740dccc0.tar.lz
android_bootable_recovery-6e02ea92ec8af1da74f55e616b7cda82740dccc0.tar.xz
android_bootable_recovery-6e02ea92ec8af1da74f55e616b7cda82740dccc0.tar.zst
android_bootable_recovery-6e02ea92ec8af1da74f55e616b7cda82740dccc0.zip
Diffstat (limited to 'otafault/ota_io.h')
-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