summaryrefslogtreecommitdiff
path: root/init/service_utils.cpp
diff options
context:
space:
mode:
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 93cffd866..d33145a2a 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;
}
}