diff options
author | Elliott Hughes <enh@google.com> | 2015-02-06 12:19:48 -0800 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2015-02-06 14:20:30 -0800 |
commit | f682b4786a4093efb23bf80d69bf80eb274b145b (patch) | |
tree | 8af209a035867fd30720e6e6da1b8b581aab871d /include | |
parent | d558530ba90cb6218fe8e255c71a034c3fe1ea58 (diff) | |
download | system_core-f682b4786a4093efb23bf80d69bf80eb274b145b.zip system_core-f682b4786a4093efb23bf80d69bf80eb274b145b.tar.gz system_core-f682b4786a4093efb23bf80d69bf80eb274b145b.tar.bz2 |
Clean up reading and writing in init.
This isn't particularly useful in and of itself, but it does introduce the
first (trivial) unit test, improves the documentation (including details
about how to debug init crashes), and made me aware of how unpleasant the
existing parser is.
I also fixed a bug in passing --- unless you thought the "peboot" and "pm"
commands were features...
Bug: 19217569
Change-Id: I6ab76129a543ce3ed3dab52ef2c638009874c3de
Diffstat (limited to 'include')
-rw-r--r-- | include/utils/file.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/utils/file.h b/include/utils/file.h index 8685ee2..a80afb1 100644 --- a/include/utils/file.h +++ b/include/utils/file.h @@ -22,8 +22,11 @@ namespace android { +bool ReadFdToString(int fd, std::string* content); bool ReadFileToString(const std::string& path, std::string* content); + bool WriteStringToFile(const std::string& content, const std::string& path); +bool WriteStringToFd(const std::string& content, int fd); #if !defined(_WIN32) bool WriteStringToFile(const std::string& content, const std::string& path, |