summaryrefslogtreecommitdiff
path: root/init/util.h
diff options
context:
space:
mode:
authorTom Cherry <tomcherry@google.com>2017-05-04 18:17:33 -0700
committerTom Cherry <tomcherry@google.com>2017-05-05 14:37:12 -0700
commit2cbbe9f7a35efdc94e8e34ef92eb6f70a85887fe (patch)
tree215ecac00aa47fbac652e5e7bc99761176884b84 /init/util.h
parent517e1f17cfec2143d4d10a64b1496a550acf3ea2 (diff)
init: do not log directly from read_file() and write_file()
Their callers may be able to add more context, so use an error string to record the error. Bug: 38038887 Test: boot bullhead Test: Init unit tests Change-Id: I46690d1c66e00a4b15cadc6fd0d6b50e990388c3
Diffstat (limited to 'init/util.h')
-rw-r--r--init/util.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/init/util.h b/init/util.h
index 4957f1550..4c33909f0 100644
--- a/init/util.h
+++ b/init/util.h
@@ -38,8 +38,8 @@ using namespace std::chrono_literals;
int create_socket(const char* name, int type, mode_t perm, uid_t uid, gid_t gid,
const char* socketcon, selabel_handle* sehandle);
-bool read_file(const std::string& path, std::string* content);
-bool write_file(const std::string& path, const std::string& content);
+bool ReadFile(const std::string& path, std::string* content, std::string* err);
+bool WriteFile(const std::string& path, const std::string& content, std::string* err);
class Timer {
public: