Add operator int() to unique_fd.
Change-Id: I7512559be7befbb8772d5529e06550267a2f1543
diff --git a/bootstat/boot_event_record_store_test.cpp b/bootstat/boot_event_record_store_test.cpp
index b7dd9ba..01c2cc1 100644
--- a/bootstat/boot_event_record_store_test.cpp
+++ b/bootstat/boot_event_record_store_test.cpp
@@ -41,7 +41,7 @@
// the value of the record.
bool CreateEmptyBootEventRecord(const std::string& record_path, int32_t value) {
android::base::unique_fd record_fd(creat(record_path.c_str(), S_IRUSR | S_IWUSR));
- if (record_fd.get() == -1) {
+ if (record_fd == -1) {
return false;
}
@@ -49,7 +49,7 @@
// ensure the validity of the file mtime value, i.e., to check that the record
// file mtime values are not changed once set.
// TODO(jhawkins): Remove this block.
- if (!android::base::WriteStringToFd(std::to_string(value), record_fd.get())) {
+ if (!android::base::WriteStringToFd(std::to_string(value), record_fd)) {
return false;
}