summaryrefslogtreecommitdiffstats
path: root/otafault
diff options
context:
space:
mode:
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