Skip to content

Commit

Permalink
Fix[codestyle]: change comment
Browse files Browse the repository at this point in the history
  • Loading branch information
artdeell committed Dec 21, 2023
1 parent 594e4cb commit 5f39dd7
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions app_pojavlauncher/src/main/jni/stdio_is.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,16 @@ _Noreturn static void nominal_exit(int code) {
// A hat trick, if you will
// Call the Android System.exit() to perform Android's shutdown hooks and do a
// fully clean exit.
jclass systemClass = (*env)->FindClass(env,"java/lang/System");
jmethodID exitMethod = (*env)->GetStaticMethodID(env, systemClass, "exit", "(I)V");
(*env)->CallStaticVoidMethod(env, systemClass, exitMethod, 0);

// Hang. Either of these will happen:
// After doing this, either of these will happen:
// 1. Runtime calls exit() for real and it will be handled by ByteHook's recurse handler
// and redirected back to the OS
// 2. Zygote sends SIGTERM (no handling necessary, the process perishes)
// 3. A different thread calls exit() and the hook will go through the exit_tripped path
jclass systemClass = (*env)->FindClass(env,"java/lang/System");
jmethodID exitMethod = (*env)->GetStaticMethodID(env, systemClass, "exit", "(I)V");
(*env)->CallStaticVoidMethod(env, systemClass, exitMethod, 0);
// System.exit() should not ever return, but the compiler doesn't know about that
// so put a while loop here
while(1) {}
}

Expand Down

0 comments on commit 5f39dd7

Please sign in to comment.