From bcabd0929316fdd022ea102cc86396547ad9f070 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 22 Mar 2016 20:19:22 -0700 Subject: Switch to . Change-Id: I13ba3f40bd52b5f3e3fe9002a45a9a8630040129 --- bootloader.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'bootloader.cpp') diff --git a/bootloader.cpp b/bootloader.cpp index d80c5e793..a32f8b4c6 100644 --- a/bootloader.cpp +++ b/bootloader.cpp @@ -29,7 +29,7 @@ #include "common.h" #include "mtdutils/mtdutils.h" #include "roots.h" -#include "unique_fd.h" +#include static int get_bootloader_message_mtd(bootloader_message* out, const Volume* v); static int set_bootloader_message_mtd(const bootloader_message* in, const Volume* v); @@ -191,8 +191,8 @@ static int get_bootloader_message_block(bootloader_message* out, static int set_bootloader_message_block(const bootloader_message* in, const Volume* v) { wait_for_device(v->blk_device); - unique_fd fd(open(v->blk_device, O_WRONLY | O_SYNC)); - if (fd.get() == -1) { + android::base::unique_fd fd(open(v->blk_device, O_WRONLY | O_SYNC)); + if (fd == -1) { LOGE("failed to open \"%s\": %s\n", v->blk_device, strerror(errno)); return -1; } @@ -201,7 +201,7 @@ static int set_bootloader_message_block(const bootloader_message* in, const uint8_t* start = reinterpret_cast(in); size_t total = sizeof(*in); while (written < total) { - ssize_t wrote = TEMP_FAILURE_RETRY(write(fd.get(), start + written, total - written)); + ssize_t wrote = TEMP_FAILURE_RETRY(write(fd, start + written, total - written)); if (wrote == -1) { LOGE("failed to write %" PRId64 " bytes: %s\n", static_cast(written), strerror(errno)); @@ -210,7 +210,7 @@ static int set_bootloader_message_block(const bootloader_message* in, written += wrote; } - if (fsync(fd.get()) == -1) { + if (fsync(fd) == -1) { LOGE("failed to fsync \"%s\": %s\n", v->blk_device, strerror(errno)); return -1; } -- cgit v1.2.3