From df8789252252c77660daf5d602d425b60b344b08 Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Thu, 13 Aug 2015 16:44:54 -0700 Subject: ART: Add FdFile constructors Make Open protected, and expose constructors instead. Add a move constructor and move assignment operator. Add OS functions that return the FdFile non-pointer version. Add tests. Bug: 21192156 Test: m test-art-host Test: m test-art-target (shamu) Change-Id: I83e390edde7cd37c900e9d5c3e4d21da22981b3f --- runtime/utils.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'runtime/utils.cc') diff --git a/runtime/utils.cc b/runtime/utils.cc index 6a50b8eee2..3f779df15a 100644 --- a/runtime/utils.cc +++ b/runtime/utils.cc @@ -136,8 +136,8 @@ void GetThreadStack(pthread_t thread, void** stack_base, size_t* stack_size, siz } bool ReadFileToString(const std::string& file_name, std::string* result) { - File file; - if (!file.Open(file_name, O_RDONLY)) { + File file(file_name, O_RDONLY, false); + if (!file.IsOpened()) { return false; } @@ -155,8 +155,8 @@ bool ReadFileToString(const std::string& file_name, std::string* result) { } bool PrintFileToLog(const std::string& file_name, LogSeverity level) { - File file; - if (!file.Open(file_name, O_RDONLY)) { + File file(file_name, O_RDONLY, false); + if (!file.IsOpened()) { return false; } -- cgit v1.2.3-59-g8ed1b