Convert system/core to Result::ok()
No functionality changes, this is a mechanical cleanup.
Test: m
Test: cd system/core && atest
Change-Id: Ifdaa3ce1947ed578f656d5a446978726eb416c36
diff --git a/init/check_builtins.cpp b/init/check_builtins.cpp
index bef6966..d62ecb0 100644
--- a/init/check_builtins.cpp
+++ b/init/check_builtins.cpp
@@ -52,7 +52,7 @@
Result<void> check_chown(const BuiltinArguments& args) {
if (!args[1].empty()) {
auto uid = DecodeUid(args[1]);
- if (!uid) {
+ if (!uid.ok()) {
return Error() << "Unable to decode UID for '" << args[1] << "': " << uid.error();
}
}
@@ -60,7 +60,7 @@
// GID is optional and pushes the index of path out by one if specified.
if (args.size() == 4 && !args[2].empty()) {
auto gid = DecodeUid(args[2]);
- if (!gid) {
+ if (!gid.ok()) {
return Error() << "Unable to decode GID for '" << args[2] << "': " << gid.error();
}
}
@@ -72,7 +72,7 @@
ReturnIfAnyArgsEmpty();
auto result = Service::MakeTemporaryOneshotService(args.args);
- if (!result) {
+ if (!result.ok()) {
return result.error();
}
@@ -93,7 +93,7 @@
}
Result<void> check_interface_restart(const BuiltinArguments& args) {
- if (auto result = IsKnownInterface(args[1]); !result) {
+ if (auto result = IsKnownInterface(args[1]); !result.ok()) {
return result.error();
}
return {};
@@ -124,7 +124,7 @@
Result<void> check_mkdir(const BuiltinArguments& args) {
auto options = ParseMkdir(args.args);
- if (!options) {
+ if (!options.ok()) {
return options.error();
}
return {};
@@ -134,7 +134,7 @@
ReturnIfAnyArgsEmpty();
auto restorecon_info = ParseRestorecon(args.args);
- if (!restorecon_info) {
+ if (!restorecon_info.ok()) {
return restorecon_info.error();
}
@@ -157,7 +157,7 @@
}
if (!value.empty()) {
- if (auto result = IsLegalPropertyValue(name, value); !result) {
+ if (auto result = IsLegalPropertyValue(name, value); !result.ok()) {
return result.error();
}
}
@@ -189,7 +189,7 @@
ReturnIfAnyArgsEmpty();
auto rlimit = ParseRlimit(args.args);
- if (!rlimit) return rlimit.error();
+ if (!rlimit.ok()) return rlimit.error();
return {};
}