EndSection returns Result<Success>
Allow it to fail. When there is an error for a section ending,
print the error pointing to the line where the section starts.
Bug: 69050941
Test: boot, init_tests
Change-Id: I1d8ed25f4b74cc9ac24d38b8075751c7d606aea8
diff --git a/init/service.cpp b/init/service.cpp
index 12acfc6..6d48368 100644
--- a/init/service.cpp
+++ b/init/service.cpp
@@ -1135,10 +1135,12 @@
return service_ ? service_->ParseLine(std::move(args)) : Success();
}
-void ServiceParser::EndSection() {
+Result<Success> ServiceParser::EndSection() {
if (service_) {
service_list_->AddService(std::move(service_));
}
+
+ return Success();
}
bool ServiceParser::IsValidName(const std::string& name) const {