summaryrefslogtreecommitdiffstats
path: root/otafault/ota_io.h
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2016-11-29 19:14:13 +0100
committerandroid-build-merger <android-build-merger@google.com>2016-11-29 19:14:13 +0100
commitaaeafe73e9bb22d82d94106c1a558bbea514bde2 (patch)
treeb155da78b0b0080341648c555d0c91406c2503ac /otafault/ota_io.h
parentMerge "Add ota_close(unique_fd&) and ota_fclose(std::unique_ptr<FILE>&)." am: eed7f607cf am: 839fbbdad3 am: 6a8e0eb164 (diff)
parentMerge "Remove ota_close(int) and ota_fclose(FILE*)." am: 7b59b45b08 am: 1f934beedd (diff)
downloadandroid_bootable_recovery-aaeafe73e9bb22d82d94106c1a558bbea514bde2.tar
android_bootable_recovery-aaeafe73e9bb22d82d94106c1a558bbea514bde2.tar.gz
android_bootable_recovery-aaeafe73e9bb22d82d94106c1a558bbea514bde2.tar.bz2
android_bootable_recovery-aaeafe73e9bb22d82d94106c1a558bbea514bde2.tar.lz
android_bootable_recovery-aaeafe73e9bb22d82d94106c1a558bbea514bde2.tar.xz
android_bootable_recovery-aaeafe73e9bb22d82d94106c1a558bbea514bde2.tar.zst
android_bootable_recovery-aaeafe73e9bb22d82d94106c1a558bbea514bde2.zip
Diffstat (limited to 'otafault/ota_io.h')
-rw-r--r--otafault/ota_io.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/otafault/ota_io.h b/otafault/ota_io.h
index 45d17b1bb..395b4230e 100644
--- a/otafault/ota_io.h
+++ b/otafault/ota_io.h
@@ -40,10 +40,6 @@ int ota_open(const char* path, int oflags, mode_t mode);
FILE* ota_fopen(const char* filename, const char* mode);
-int ota_close(int fd);
-
-int ota_fclose(FILE* fh);
-
size_t ota_fread(void* ptr, size_t size, size_t nitems, FILE* stream);
ssize_t ota_read(int fd, void* buf, size_t nbyte);
@@ -55,15 +51,19 @@ 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);
- }
+ static void Close(int);
};
using unique_fd = android::base::unique_fd_impl<OtaCloser>;
int ota_close(unique_fd& fd);
-int ota_fclose(std::unique_ptr<FILE, int (*)(FILE*)>& fh);
+struct OtaFcloser {
+ void operator()(FILE*);
+};
+
+using unique_file = std::unique_ptr<FILE, OtaFcloser>;
+
+int ota_fclose(unique_file& fh);
#endif