From 4bd58951456ac6082e23a1931293965852c24281 Mon Sep 17 00:00:00 2001 From: Bernie Innocenti Date: Thu, 6 Feb 2020 15:43:57 +0900 Subject: Convert art/ to Result::ok() No functionality changes, this is a mechanical cleanup. Test: m Change-Id: I10030314ad8a06d49a63f1e2f3c5aa5b484e34b6 --- libnativeloader/native_loader.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libnativeloader/native_loader.cpp') diff --git a/libnativeloader/native_loader.cpp b/libnativeloader/native_loader.cpp index efcb76992f..4e5189b4bf 100644 --- a/libnativeloader/native_loader.cpp +++ b/libnativeloader/native_loader.cpp @@ -94,7 +94,7 @@ jstring CreateClassLoaderNamespace(JNIEnv* env, int32_t target_sdk_version, jobj std::lock_guard guard(g_namespaces_mutex); auto ns = g_namespaces->Create(env, target_sdk_version, class_loader, is_shared, dex_path, library_path, permitted_path); - if (!ns) { + if (!ns.ok()) { return env->NewStringUTF(ns.error().message().c_str()); } #else @@ -140,7 +140,7 @@ void* OpenNativeLibrary(JNIEnv* env, int32_t target_sdk_version, const char* pat Result isolated_ns = g_namespaces->Create(env, target_sdk_version, class_loader, false /* is_shared */, nullptr, library_path, nullptr); - if (!isolated_ns) { + if (!isolated_ns.ok()) { *error_msg = strdup(isolated_ns.error().message().c_str()); return nullptr; } else { @@ -224,13 +224,13 @@ void NativeLoaderFreeErrorMessage(char* msg) { void* OpenNativeLibraryInNamespace(NativeLoaderNamespace* ns, const char* path, bool* needs_native_bridge, char** error_msg) { auto handle = ns->Load(path); - if (!handle && error_msg != nullptr) { + if (!handle.ok() && error_msg != nullptr) { *error_msg = strdup(handle.error().message().c_str()); } if (needs_native_bridge != nullptr) { *needs_native_bridge = ns->IsBridged(); } - return handle ? *handle : nullptr; + return handle.ok() ? *handle : nullptr; } // native_bridge_namespaces are not supported for callers of this function. -- cgit v1.2.3-59-g8ed1b