While looking for other occurrences of the bug being fixed by
6600199: (process) Decode system error messages using platform encoding (unix)
I noticed these uses of strerror
./solaris/native/sun/tools/attach/SolarisVirtualMachine.c:76: char* msg = strdup(strerror(err));
./solaris/native/sun/tools/attach/SolarisVirtualMachine.c:126: char* msg = strdup(strerror(res));
./solaris/native/sun/tools/attach/LinuxVirtualMachine.c:179: char* msg = strdup(strerror(err));
./solaris/native/sun/tools/attach/LinuxVirtualMachine.c:381: char* msg = strdup(strerror(res));
that appear to be incorrect. I suggest replacing
char* msg = strdup(strerror(err));
JNU_ThrowIOException(env, msg);
if (msg != NULL) {
free(msg);
}
with a call to JNU_ThrowIOExceptionWithLastError,
which is simpler and more correct.