Create libbase.
Move StringPrintf and the string based file I/O from libutils to
libbase.
Change-Id: I0297a6063874b9d92100e0dd5123fddfbda932fe
diff --git a/init/util.cpp b/init/util.cpp
index 3dddb15..c805083 100644
--- a/init/util.cpp
+++ b/init/util.cpp
@@ -32,11 +32,11 @@
#include <sys/socket.h>
#include <sys/un.h>
+#include <base/file.h>
+
/* for ANDROID_SOCKET_* */
#include <cutils/sockets.h>
-#include <utils/file.h>
-
#include <private/android_filesystem_config.h>
#include "init.h"
@@ -168,7 +168,7 @@
return false;
}
- bool okay = android::ReadFdToString(fd, content);
+ bool okay = android::base::ReadFdToString(fd, content);
TEMP_FAILURE_RETRY(close(fd));
if (okay) {
content->append("\n", 1);
@@ -181,7 +181,7 @@
if (fd == -1) {
return -errno;
}
- int result = android::WriteStringToFd(content, fd) ? 0 : -errno;
+ int result = android::base::WriteStringToFd(content, fd) ? 0 : -errno;
TEMP_FAILURE_RETRY(close(fd));
return result;
}