OSDN Git Service

Returning JNI_ERR from JNI_OnLoad is still an error!
authorElliott Hughes <enh@google.com>
Fri, 2 Aug 2013 23:49:57 +0000 (16:49 -0700)
committerElliott Hughes <enh@google.com>
Fri, 2 Aug 2013 23:49:57 +0000 (16:49 -0700)
Fixes a bug introduced in the previous patch.

Change-Id: I34ea63d323a0125c3c4ae140a2ae9b8e9ed3e1df

vm/Native.cpp

index a024db8..02fb46d 100644 (file)
@@ -411,7 +411,7 @@ bool dvmLoadNativeCode(const char* pathName, Object* classLoader,
         if (verbose)
             ALOGD("Added shared lib %s %p", pathName, classLoader);
 
-        bool result = true;
+        bool result = false;
         void* vonLoad;
         int version;
 
@@ -453,7 +453,8 @@ bool dvmLoadNativeCode(const char* pathName, Object* classLoader,
                  * newly-registered native method calls.  We could try to
                  * unregister them, but that doesn't seem worthwhile.
                  */
-                result = false;
+            } else {
+                result = true;
             }
             if (gDvm.verboseJni) {
                 ALOGI("[Returned %s from JNI_OnLoad for \"%s\"]",