changeset 17346:5f3b8ab066d2

8161431: JNI pending exceptions in ProcessHandleImpl_linux.c and ProcessHandleImpl_unix.c Reviewed-by: naoto
author rriggs
date Mon, 08 Aug 2016 13:55:16 -0400
parents 28022a67ecca
children 67e8b431911d
files src/java.base/linux/native/libjava/ProcessHandleImpl_linux.c src/java.base/unix/native/libjava/ProcessHandleImpl_unix.c
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/linux/native/libjava/ProcessHandleImpl_linux.c	Mon Aug 08 20:16:53 2016 +0300
+++ b/src/java.base/linux/native/libjava/ProcessHandleImpl_linux.c	Mon Aug 08 13:55:16 2016 -0400
@@ -146,6 +146,7 @@
     snprintf(fn, sizeof fn, "/proc/%d", pid);
     if (stat(fn, &stat_buf) == 0) {
         unix_getUserInfo(env, jinfo, stat_buf.st_uid);
+        JNU_CHECK_EXCEPTION(env);
     }
 
     /*
--- a/src/java.base/unix/native/libjava/ProcessHandleImpl_unix.c	Mon Aug 08 20:16:53 2016 +0300
+++ b/src/java.base/unix/native/libjava/ProcessHandleImpl_unix.c	Mon Aug 08 13:55:16 2016 -0400
@@ -429,7 +429,9 @@
 
     if (nargs >= 1) {
         // Create a String array for nargs-1 elements
-        argsArray = (*env)->NewObjectArray(env, nargs - 1, JNU_ClassString(env), NULL);
+        jclass clazzString = JNU_ClassString(env);
+        CHECK_NULL(clazzString);
+        argsArray = (*env)->NewObjectArray(env, nargs - 1, clazzString, NULL);
         CHECK_NULL(argsArray);
 
         for (i = 0; i < nargs - 1; i++) {