summaryrefslogtreecommitdiff
path: root/init/init.cpp
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/init.cpp
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/init.cpp')
-rw-r--r--init/init.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/init/init.cpp b/init/init.cpp
index 52f6b0cec..b5f97e5c8 100644
--- a/init/init.cpp
+++ b/init/init.cpp
@@ -853,7 +853,9 @@ static void selinux_initialize(bool in_kernel_domain) {
}
}
- if (!write_file("/sys/fs/selinux/checkreqprot", "0")) {
+ std::string err;
+ if (!WriteFile("/sys/fs/selinux/checkreqprot", "0", &err)) {
+ LOG(ERROR) << err;
security_failure();
}