mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-04-07 11:08:36 +00:00
Fix JNI command-line interface; return 255 instead of -1
This commit is contained in:
parent
e230bbc40b
commit
5b85520f75
@ -148,7 +148,7 @@ JNIEXPORT jint JNICALL Java_org_servalproject_servald_ServalD_rawCommand(JNIEnv
|
||||
{
|
||||
jclass stringClass = NULL;
|
||||
jclass listClass = NULL;
|
||||
jint status = 0;
|
||||
unsigned char status = 0; // to match what the shell gets: 0..255
|
||||
// Enforce non re-entrancy.
|
||||
if (jni_env) {
|
||||
jclass exceptionClass = NULL;
|
||||
@ -213,7 +213,7 @@ JNIEXPORT jint JNICALL Java_org_servalproject_servald_ServalD_rawCommand(JNIEnv
|
||||
// Deal with Java exceptions: NewStringUTF out of memory in outv_end_field().
|
||||
if (jni_exception || (outv_current != outv_buffer && outv_end_field() == -1))
|
||||
return -1;
|
||||
return status;
|
||||
return (jint) status;
|
||||
}
|
||||
|
||||
#endif /* HAVE_JNI_H */
|
||||
|
Loading…
x
Reference in New Issue
Block a user