summaryrefslogtreecommitdiff
path: root/init/builtins.cpp
diff options
context:
space:
mode:
authorTom Cherry <tomcherry@google.com>2017-06-23 20:01:41 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-06-23 20:01:41 +0000
commit1a23b2aef506f725501ee9b7bbb272a8b08faa63 (patch)
treec61701d57f84d05ea3ed530c1c3834fb942191c6 /init/builtins.cpp
parenta91e4f205fdd1eb5bf7e5f63117bafa1311f827f (diff)
parent288fb7c2cc6063720b7792dc6aa73db7e9be910a (diff)
Merge "init: cleanup some string usage" am: 84c2eebbdd am: 77382acf42
am: 288fb7c2cc Change-Id: I61e6ee578e55ebe343112c8114816ac4e18b9c7e
Diffstat (limited to 'init/builtins.cpp')
-rw-r--r--init/builtins.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/init/builtins.cpp b/init/builtins.cpp
index bdd86ed2e..91672f550 100644
--- a/init/builtins.cpp
+++ b/init/builtins.cpp
@@ -43,7 +43,6 @@
#include <android-base/logging.h>
#include <android-base/parseint.h>
#include <android-base/properties.h>
-#include <android-base/stringprintf.h>
#include <android-base/strings.h>
#include <bootloader_message/bootloader_message.h>
#include <cutils/android_reboot.h>
@@ -552,11 +551,10 @@ static int do_mount_all(const std::vector<std::string>& args) {
}
}
- std::string prop_name = android::base::StringPrintf("ro.boottime.init.mount_all.%s",
- prop_post_fix);
+ std::string prop_name = "ro.boottime.init.mount_all."s + prop_post_fix;
Timer t;
int ret = mount_fstab(fstabfile, mount_mode);
- property_set(prop_name.c_str(), std::to_string(t.duration_ms()).c_str());
+ property_set(prop_name, std::to_string(t.duration_ms()));
if (import_rc) {
/* Paths of .rc files are specified at the 2nd argument and beyond */
@@ -584,9 +582,7 @@ static int do_swapon_all(const std::vector<std::string>& args) {
}
static int do_setprop(const std::vector<std::string>& args) {
- const char* name = args[1].c_str();
- const char* value = args[2].c_str();
- property_set(name, value);
+ property_set(args[1], args[2]);
return 0;
}
@@ -669,8 +665,7 @@ static int do_verity_load_state(const std::vector<std::string>& args) {
static void verity_update_property(fstab_rec *fstab, const char *mount_point,
int mode, int status) {
- property_set(android::base::StringPrintf("partition.%s.verified", mount_point).c_str(),
- android::base::StringPrintf("%d", mode).c_str());
+ property_set("partition."s + mount_point + ".verified", std::to_string(mode));
}
static int do_verity_update_state(const std::vector<std::string>& args) {