summaryrefslogtreecommitdiff
path: root/init/bootchart.cpp
diff options
context:
space:
mode:
authorTom Cherry <tomcherry@google.com>2019-06-10 11:08:01 -0700
committerTom Cherry <tomcherry@google.com>2019-06-10 12:39:18 -0700
commitbbcbc2ffb339b2388e0cc282bb698fe436100b42 (patch)
tree3b1ab414d943a4a9b50dd29c581807fa2092ed06 /init/bootchart.cpp
parentcaa95d551d7f3b86d609b09bb4ab98e2435f6bc8 (diff)
downloadcore-bbcbc2ffb339b2388e0cc282bb698fe436100b42.tar.gz
init: replace Result<Success> with Result<void>
Now that Result<T> is actually expected<T, ...>, and the expected proposal states expected<void, ...> as the way to indicate an expected object that returns either successfully with no object or an error, let's move init's Result<Success> to the preferred Result<void>. Bug: 132145659 Test: boot, init unit tests Change-Id: Ib2f98396d8e6e274f95a496fcdfd8341f77585ee
Diffstat (limited to 'init/bootchart.cpp')
-rw-r--r--init/bootchart.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/init/bootchart.cpp b/init/bootchart.cpp
index c2cf57399..b7db9b6d6 100644
--- a/init/bootchart.cpp
+++ b/init/bootchart.cpp
@@ -165,20 +165,20 @@ static void bootchart_thread_main() {
LOG(INFO) << "Bootcharting finished";
}
-static Result<Success> do_bootchart_start() {
+static Result<void> do_bootchart_start() {
// We don't care about the content, but we do care that /data/bootchart/enabled actually exists.
std::string start;
if (!android::base::ReadFileToString("/data/bootchart/enabled", &start)) {
LOG(VERBOSE) << "Not bootcharting";
- return Success();
+ return {};
}
g_bootcharting_thread = new std::thread(bootchart_thread_main);
- return Success();
+ return {};
}
-static Result<Success> do_bootchart_stop() {
- if (!g_bootcharting_thread) return Success();
+static Result<void> do_bootchart_stop() {
+ if (!g_bootcharting_thread) return {};
// Tell the worker thread it's time to quit.
{
@@ -190,10 +190,10 @@ static Result<Success> do_bootchart_stop() {
g_bootcharting_thread->join();
delete g_bootcharting_thread;
g_bootcharting_thread = nullptr;
- return Success();
+ return {};
}
-Result<Success> do_bootchart(const BuiltinArguments& args) {
+Result<void> do_bootchart(const BuiltinArguments& args) {
if (args[1] == "start") return do_bootchart_start();
return do_bootchart_stop();
}