Skip to content

Commit

Permalink
Correct return type of JVM_LoadZipLibrary()
Browse files Browse the repository at this point in the history
Signed-off-by: Keith W. Campbell <keithc@ca.ibm.com>
wip

Signed-off-by: Keith W. Campbell <keithc@ca.ibm.com>
Implement JVM_LoadZipLibrary()

Signed-off-by: Keith W. Campbell <keithc@ca.ibm.com>
  • Loading branch information
keithc-ca committed Aug 30, 2023
1 parent da88423 commit 1578cc5
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions runtime/j9vm/javanextvmi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,26 @@ JVM_ReportFinalizationComplete(JNIEnv *env, jobject obj)
JNIEXPORT void * JNICALL
JVM_LoadZipLibrary(void)
{
Assert_SC_true(!"JVM_LoadZipLibrary unimplemented");
return NULL;
void *zipHandle = NULL;
J9JavaVM *vm = BFUjavaVM;

if (NULL != vm) {
PORT_ACCESS_FROM_JAVAVM(vm);
uintptr_t handle = 0;

if (J9PORT_SL_FOUND == j9sl_open_shared_library(
(char *)"zip",
&handle,
OMRPORT_SLOPEN_DECORATE | OMRPORT_SLOPEN_LAZY)
) {
zipHandle = (void *)handle;
}
}

/* We may as well assert here: we won't make much progress without the library. */
Assert_SC_notNull(zipHandle);

return zipHandle;
}

JNIEXPORT void JNICALL
Expand Down

0 comments on commit 1578cc5

Please sign in to comment.