summaryrefslogtreecommitdiff
path: root/init/service_utils.cpp
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2020-02-07 06:14:16 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2020-02-07 06:14:16 +0000
commit39e990d477bef81f97dae63ceb0a78c9098b8183 (patch)
treea63c1db95284858e8f86e5e4f69e113831819cec /init/service_utils.cpp
parent9b7d688ea407e0e9ebac2a57ff35267dfa6f78be (diff)
parentcecebbbaccd36dc2e9f6e80c8e91e57d979963a5 (diff)
Merge "Convert system/core to Result::ok()"
Diffstat (limited to 'init/service_utils.cpp')
-rw-r--r--init/service_utils.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/init/service_utils.cpp b/init/service_utils.cpp
index eec571785..484c2c89f 100644
--- a/init/service_utils.cpp
+++ b/init/service_utils.cpp
@@ -167,7 +167,7 @@ void Descriptor::Publish() const {
Result<Descriptor> SocketDescriptor::Create(const std::string& global_context) const {
const auto& socket_context = context.empty() ? global_context : context;
auto result = CreateSocket(name, type | SOCK_CLOEXEC, passcred, perm, uid, gid, socket_context);
- if (!result) {
+ if (!result.ok()) {
return result.error();
}
@@ -196,7 +196,7 @@ Result<Descriptor> FileDescriptor::Create() const {
Result<void> EnterNamespaces(const NamespaceInfo& info, const std::string& name, bool pre_apexd) {
for (const auto& [nstype, path] : info.namespaces_to_enter) {
- if (auto result = EnterNamespace(nstype, path.c_str()); !result) {
+ if (auto result = EnterNamespace(nstype, path.c_str()); !result.ok()) {
return result;
}
}
@@ -214,14 +214,14 @@ Result<void> EnterNamespaces(const NamespaceInfo& info, const std::string& name,
bool remount_sys =
std::any_of(info.namespaces_to_enter.begin(), info.namespaces_to_enter.end(),
[](const auto& entry) { return entry.first == CLONE_NEWNET; });
- if (auto result = SetUpMountNamespace(remount_proc, remount_sys); !result) {
+ if (auto result = SetUpMountNamespace(remount_proc, remount_sys); !result.ok()) {
return result;
}
}
if (info.flags & CLONE_NEWPID) {
// This will fork again to run an init process inside the PID namespace.
- if (auto result = SetUpPidNamespace(name.c_str()); !result) {
+ if (auto result = SetUpPidNamespace(name.c_str()); !result.ok()) {
return result;
}
}