summaryrefslogtreecommitdiffstats
path: root/init/util.cpp
diff options
context:
space:
mode:
authorTom Cherry <tomcherry@google.com>2015-05-12 13:54:41 -0700
committerElliott Hughes <enh@google.com>2015-05-12 19:42:38 -0700
commitcce7e93b287835ffe9cdc3dad3fac52972d84560 (patch)
tree85f66bc9b1e39bdf7988e1a841bd6716cab20030 /init/util.cpp
parent30cc3d72498326c77b75cdf02992211d31396b33 (diff)
downloadcore-cce7e93b287835ffe9cdc3dad3fac52972d84560.tar.gz
core-cce7e93b287835ffe9cdc3dad3fac52972d84560.tar.bz2
core-cce7e93b287835ffe9cdc3dad3fac52972d84560.zip
Fix insmod module size
read_file() used to append a new line character to the end of the buffer it returns, because parse_config() isn't able to cope with input that's not '\n'-terminated. Fix read_file() to be less insane, and push the workarounds into the parse_config() callers. Longer term we should rewrite parse_config(). Bug: http://b/21079470 Change-Id: Ie9d9a7adcd33b66621726aef20c4b8cc51c08be7 (cherry picked from commit eaa3b4ec6f79fe06163b8dd6fe8ba2581d3b9c0b)
Diffstat (limited to 'init/util.cpp')
-rw-r--r--init/util.cpp4
1 files changed, 0 insertions, 4 deletions
diff --git a/init/util.cpp b/init/util.cpp
index d6fd0fc96..df4c25f21 100644
--- a/init/util.cpp
+++ b/init/util.cpp
@@ -171,9 +171,6 @@ bool read_file(const char* path, std::string* content) {
bool okay = android::base::ReadFdToString(fd, content);
TEMP_FAILURE_RETRY(close(fd));
- if (okay) {
- content->append("\n", 1);
- }
return okay;
}
@@ -475,4 +472,3 @@ std::string bytes_to_hex(const uint8_t* bytes, size_t bytes_len) {
android::base::StringAppendF(&hex, "%02x", bytes[i]);
return hex;
}
-